home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 2 / Amiga Tools 2.iso / rexx / answervoice.avm < prev    next >
Text File  |  1995-03-09  |  96KB  |  3,497 lines

  1. /* TITLE: avm:rexx/answervoice.avm */
  2. /* we want results! Otherwise, we wouldn't get anything from RESULT */
  3. options results
  4.  
  5. /* Need to make sure that stdtail.avm is also included */
  6. signal on halt
  7. signal on novalue
  8. signal on syntax
  9. signal on break_c
  10.  
  11. /* needed for some of the functions we use */
  12. call addlib("rexxsupport.library", 0, -30, 0)
  13.  
  14. /* a higher than normal priority since calls are important to us :) */
  15. call pragma('priority', 1)
  16.  
  17. /* ensure that commands are directed to the correct server */
  18. parse arg servername .
  19. address value servername
  20.  
  21.  
  22. introtype = getclip('AVMIntroductionType')
  23. if upper(introtype) = 'DAYOFWEEK' then
  24.   intronumber = dayofweek2num()
  25. else if upper(introtype) = 'TIMEOFDAY' then
  26.   intronumber = timeofday2num()
  27. else if upper(introtype) = 'RANDOM' then
  28.   intronumber = random(1,7, time('s'))
  29. else if introtype = "" then
  30.   intronumber = 1
  31. else intronumber = introtype
  32. signal value 'avintro' || intronumber
  33.  
  34. answervoiceStart:
  35. parse arg servername faxscript datascript distinctivering 'CID$' acidname '$' acidnumber '$'
  36. call setclip(address() || 'FAXSCRIPT', faxscript)
  37. call setclip(address() || 'DATASCRIPT', datascript)
  38. call setclip(address() || 'CIDNAME', acidname)
  39. call setclip(address() || 'CIDNUMBER', acidnumber)
  40.  
  41. startup:
  42. simple = getclip('AVMSimpleAnsweringMachine')
  43. if upper(simple) = 'YES' then call simplestartup
  44. else call multistartup
  45. exit
  46.  
  47. answervoiceDone:
  48. 'playvoice' 'avm:voices/Goodbye'
  49. action = rc
  50. select
  51.   when action = 0 then nop
  52.   when action = 1 then nop
  53.   when action = 4 then signal stdfax
  54.   when action = 5 then signal stddata
  55.   when action = 8 then signal stdbusy
  56.   when action = 12 then signal stdabort
  57.   when action = 14 then signal stderror
  58.   when action = 16 then signal stderror
  59.   otherwise signal arexxerror
  60. end
  61. exit
  62.  
  63. /* TITLE: avm:rexx/stdtail.avm */
  64. /* This is the standard tail */
  65. exit
  66.  
  67. exit
  68.  
  69. mailboxDir: procedure
  70.     parse arg mailbox
  71.  
  72.     return 'avm:' || mailbox || '/'
  73.  
  74. logFile: procedure
  75.     parse arg mailbox, magiccookie
  76.  
  77.     return 'avm:' || mailbox || '/logs/' || magiccookie
  78.  
  79. voiceFile: procedure
  80.     parse arg mailbox, magiccookie
  81.  
  82.         if (verify(magiccookie, '/:', 'M') = 0) then
  83.           return 'avm:' || mailbox || '/voices/' || magiccookie
  84.         else
  85.           return magiccookie
  86.  
  87. makeUniqueFile: procedure
  88.     if arg() ~= 0 then do
  89.         rc = "makeUniqueFile: bad args"
  90.         signal error
  91.     end
  92.     return address() || '.' || date('i') || '.' || time('s') || '.' || random(1, 999, time('s'))
  93.  
  94. convertToDate: procedure
  95.     if arg() ~= 1 then do
  96.         rc = "convertToDate: bad args"
  97.         signal error
  98.     end
  99.     parse arg timeInC
  100.  
  101.     actualTime = (timeInC - (2922)*86400) // (86400)
  102.     actualDate = (timeInC - actualTime - 2922*86400) % 86400
  103.  
  104.     return actualDate /* returning it in 'internal' format */
  105.  
  106. convertToTime: procedure
  107.     if arg() ~= 1 then do
  108.         rc = "convertToTime: bad args"
  109.         signal error
  110.     end
  111.     parse arg timeInC
  112.     
  113.     actualTime = (timeInC - (2922)*86400) // (86400)
  114.  
  115.     return actualTime
  116.  
  117. cTime: procedure
  118.     /* 2922 = 8*365 + 2 */
  119.     /* 86400 = 24*60*60 */
  120.     return (date('i')+2922)*86400 + time('s')
  121.  
  122. /* this returns a handle that you must use after initializing log. */
  123. initLogEntry: procedure expose log.
  124.     if arg() ~= 0 then do
  125.         rc = "initLogEntry: bad args"
  126.         signal error
  127.     end
  128.     
  129.     drop log.
  130.         log. = ''
  131.  
  132.         acidname = getclip(address() || 'CIDNAME')
  133.         acidnumber = getclip(address() || 'CIDNUMBER')
  134.  
  135.     /* 2922 = 8*365 + 2 */
  136.     /* 86400 = 24*60*60 */
  137.     log.time = (date('i')+2922)*86400 + time('s')
  138.     log.cidname = acidname
  139.     log.cidnumber = acidnumber
  140.  
  141.     return
  142.  
  143. loadLogEntry: procedure expose log.
  144.     if arg() ~= 2 then do
  145.         rc = "loadLogEntry: bad args"
  146.         signal error
  147.     end
  148.     parse arg mailbox, handle
  149.  
  150.         drop log.
  151.         log. = ''
  152.  
  153.     if ~exists(mailboxDir(mailbox)) then do
  154.         call showDebugger('Dir=' || mailboxDir(mailbox) 'does not exist')
  155.         return
  156.     end
  157.  
  158.     opened = open(handle, logFile(mailbox, handle), 'r')
  159.         if opened then do
  160.         call showDebugger('Loading entry' logFile(mailbox, handle))
  161.         do while ~eof(handle)
  162.             line = readln(handle)
  163.             parse upper var line variable '=' value
  164.             log.variable = value
  165.         end
  166.         call close(handle)
  167.     end; else call showDebugger('Could not load' logFile(mailbox, handle))
  168.     return
  169.  
  170. /* pass a handle here */
  171. saveLogEntry: procedure expose log.
  172.     if arg() ~= 2 then do
  173.         rc = "saveLogEntry: bad args"
  174.         signal error
  175.     end
  176.     parse arg mailbox, handle
  177.  
  178.     if ~exists(mailboxDir(mailbox)) then do
  179.         call showDebugger('Dir=' || mailboxDir(mailbox) 'does not exist')
  180.         return
  181.     end
  182.  
  183.     opened = open(handle, logFile(mailbox, handle), 'w')
  184.  
  185.     if opened then do
  186.         call showDebugger('Saving entry' logFile(mailbox, handle))
  187.         call writeln(handle, 'TYPE=' || log.type)
  188.         call writeln(handle, 'TIME=' || log.time)
  189.         call writeln(handle, 'LENGTH=' || log.length)
  190.  
  191.         call writeln(handle, 'ORIGMAILBOX=' || log.origmailbox)
  192.  
  193.         call writeln(handle, 'CIDNAME=' || log.cidname)
  194.         call writeln(handle, 'CIDNUMBER=' || log.cidnumber)
  195.  
  196.         call writeln(handle, 'COMMENT=' || log.comment)
  197.  
  198.         call writeln(handle, 'FILENAME=' || log.filename)
  199.         call writeln(handle, 'ALTFILENAME=' || log.altfilename)
  200.  
  201.         call writeln(handle, 'RETURNNUMBER=' || log.returnnumber)
  202.         call writeln(handle, 'RETURNSENDFUNC=' || log.returnsendfunc)
  203.         call writeln(handle, 'RETURNSTATUS=' || log.returnstatus)
  204.  
  205.         call writeln(handle, 'RETURNRETRY=' || log.returnretry)
  206.         call writeln(handle, 'RETURNINTERVAL=' || log.returninterval)
  207.  
  208.         call close(handle)
  209.         address rexx 'broadcast' 'addtomailbox' mailbox handle
  210.     end; else call showDebugger('Could not save' logFile(mailbox, handle))
  211.  
  212.     return
  213.  
  214. /* pass a handle here */
  215. updateLogEntry: procedure expose log.
  216.     if arg() ~= 2 then do
  217.         rc = "updateLogEntry: bad args"
  218.         signal error
  219.     end
  220.     parse arg mailbox, handle
  221.  
  222.     if ~exists(mailboxDir(mailbox)) then do
  223.         call showDebugger('Dir=' || mailboxDir(mailbox) 'does not exist')
  224.         return
  225.     end
  226.  
  227.     if ~exists(logFile(mailbox, handle)) then do
  228.         call showDebugger('Unable to update non-existent' logFile(mailbox, handle))
  229.         return
  230.     end
  231.     opened = open(handle, logFile(mailbox, handle), 'w')
  232.  
  233.     if opened then do
  234.         call showDebugger('Updating entry' logFile(mailbox, handle))
  235.         call writeln(handle, 'TYPE=' || log.type)
  236.         call writeln(handle, 'TIME=' || log.time)
  237.         call writeln(handle, 'LENGTH=' || log.length)
  238.  
  239.         call writeln(handle, 'ORIGMAILBOX=' || log.origmailbox)
  240.  
  241.         call writeln(handle, 'CIDNAME=' || log.cidname)
  242.         call writeln(handle, 'CIDNUMBER=' || log.cidnumber)
  243.  
  244.         call writeln(handle, 'COMMENT=' || log.comment)
  245.  
  246.         call writeln(handle, 'FILENAME=' || log.filename)
  247.         call writeln(handle, 'ALTFILENAME=' || log.altfilename)
  248.  
  249.         call writeln(handle, 'RETURNNUMBER=' || log.returnnumber)
  250.         call writeln(handle, 'RETURNSENDFUNC=' || log.returnsendfunc)
  251.         call writeln(handle, 'RETURNSTATUS=' || log.returnstatus)
  252.  
  253.         call writeln(handle, 'RETURNRETRY=' || log.returnretry)
  254.         call writeln(handle, 'RETURNINTERVAL=' || log.returninterval)
  255.  
  256.         call close(handle)
  257.         address rexx 'broadcast' 'refreshmailboxentry' mailbox handle
  258.     end; else call showDebugger('Could not update' logFile(mailbox, handle))
  259.  
  260.     return
  261.  
  262.  
  263.  
  264. showDebugger: procedure
  265.     if arg() ~= 1 then do
  266.         say "showDebugger: ERROR"
  267.         exit 20
  268.     end
  269.  
  270.     parse arg debuggerInfo
  271.     
  272.     firstLine = sourceline(1)
  273.     parse var firstLine '/*' 'TITLE:' title '*/'
  274.     if showlist('p', 'AVMLOGGER') then
  275.         address 'AVMLOGGER' 'add' title ':' debuggerInfo
  276.     else
  277.         say title ':' debuggerInfo
  278.  
  279.     return 
  280.  
  281. /*-----------------------------------------------------------------------*/
  282. /*                         signal processing                             */
  283.  
  284. arexxerror:
  285. error:
  286.     call showDebugger("Error" rc "at line" sigl)
  287.     exit 20
  288.  
  289. break_c:
  290. halt:
  291.     call showDebugger("Halt/Break_C at line" sigl)
  292.     exit 20
  293.  
  294. novalue:
  295.     call showDebugger("No value at line" sigl)
  296.     exit 20
  297.  
  298. syntax:
  299.     call showDebugger("Syntax error" rc "at line" sigl)
  300.     exit 20
  301.  
  302. exit
  303.  
  304. /* this requires logfunctions.avm */
  305.  
  306. loadMailbox: procedure expose mailbox.
  307.     if arg() ~= 1 then do
  308.         rc = "loadMailbox: bad args"
  309.         signal error
  310.     end
  311.  
  312.         mailbox. = ''
  313.     parse arg mailbox
  314.  
  315.     handle = 'mailboxconfig'
  316.     opened = open(handle, mailboxDir(mailbox) || 'mailbox.cfg', 'r')
  317.     if opened then do
  318.         do while ~eof(handle)
  319.             line = readln(handle)
  320.             parse upper var line variable '=' value
  321.             mailbox.variable = value
  322.         end
  323.         call close(handle)
  324.     end
  325.     return
  326.  
  327. /* pass a handle here */
  328. saveMailbox: procedure expose mailbox.
  329.     if arg() ~= 1 then do
  330.         rc = "saveMailbox: bad args"
  331.         signal error
  332.     end
  333.     parse arg mailbox
  334.  
  335.     handle = 'mailboxconfig'
  336.     opened = open(handle, mailboxDir(mailbox) || 'mailbox.cfg', 'w')
  337.  
  338.     if opened then do
  339.         call writeln(handle, 'PASSWORD=' || mailbox.password)
  340.  
  341.         call writeln(handle, 'AUTOFAXFORWARDB=' || mailbox.autofaxforwardb)
  342.         call writeln(handle, 'AUTOFAXFORWARD=' || mailbox.autofaxforward)
  343.         call writeln(handle, 'AUTOFAXFORWARDSCRIPT=' || mailbox.autofaxforwardscript)
  344.  
  345.         call writeln(handle, 'AUTOFORWARDB=' || mailbox.autoforwardb)
  346.         call writeln(handle, 'AUTOFORWARDONDEMAND=' || mailbox.autoforwardondemand)
  347.         call writeln(handle, 'AUTOFORWARD=' || mailbox.autoforward)
  348.         call writeln(handle, 'AUTOFORWARDSCRIPT=' || mailbox.autoforwardscript)
  349.  
  350.         call writeln(handle, 'AUTOPAGEB=' || mailbox.autopageb)
  351.         call writeln(handle, 'AUTOPAGEONDEMAND=' || mailbox.autopageondemand)
  352.         call writeln(handle, 'AUTOPAGE=' || mailbox.autopage)
  353.         call writeln(handle, 'AUTOPAGESCRIPT=' || mailbox.autopagescript)
  354.  
  355.         call writeln(handle, 'AUTOALERTB=' || mailbox.autoalertb)
  356.         call writeln(handle, 'AUTOALERTONDEMAND=' || mailbox.autoalertondemand)
  357.         call writeln(handle, 'AUTOALERTSCRIPT=' || mailbox.autoalertscript)
  358.  
  359.         call close(handle)
  360.     end
  361.  
  362.     return
  363.  
  364. /* TITLE: avm:rexx/getnumber.avm */
  365. getnumber:
  366. procedure
  367.  
  368. aagetnumberagain:
  369. 'playvoice' 'avm:voices/GetNumber'
  370. action = rc
  371. select
  372.   when action = 0 then nop
  373.   when action = 1 then nop
  374.   when action = 4 then signal stdfax
  375.   when action = 5 then signal stddata
  376.   when action = 8 then signal stdbusy
  377.   when action = 12 then signal stdabort
  378.   when action = 14 then signal stderror
  379.   when action = 16 then signal stderror
  380.   otherwise signal arexxerror
  381. end
  382.  
  383. 'readkeysuntil' '#' '15' '7'
  384. action = rc
  385. if action = 0 then value = result
  386. select
  387.   when action = 0 then do; number = value; end
  388.   when action = 4 then signal stdfax
  389.   when action = 5 then signal stddata
  390.   when action = 8 then signal stdbusy
  391.   when action = 10 then do; number = ''; end
  392.   when action = 12 then signal stdabort
  393.   when action = 14 then signal stderror
  394.   when action = 16 then signal stderror
  395.   otherwise signal arexxerror
  396. end
  397.  
  398. 'playvoice' 'avm:voices/NumberEntered'
  399. action = rc
  400. select
  401.   when action = 0 then nop
  402.   when action = 1 then nop
  403.   when action = 4 then signal stdfax
  404.   when action = 5 then signal stddata
  405.   when action = 8 then signal stdbusy
  406.   when action = 12 then signal stdabort
  407.   when action = 14 then signal stderror
  408.   when action = 16 then signal stderror
  409.   otherwise signal arexxerror
  410. end
  411.  
  412. call playNumber(number)
  413.  
  414. aagetnumbermenu:
  415. call aapresentmenu('avm:voices/numbercorrect', '02#*', '3')
  416. action = result
  417. select
  418.   when action = '=0' then signal aagetnumbermenu
  419.   when action = '=1' then nop
  420.   when action = '=2' then signal aagetnumberagain
  421.   when action = '=3' then nop
  422.   when action = '=4' then nop
  423.   when action = '=5' then nop
  424.   when action = '=6' then nop
  425.   when action = '=7' then nop
  426.   when action = '=8' then nop
  427.   when action = '=9' then nop
  428.   when action = '=#' then signal aagetnumberdone
  429.   when action = '=*' then signal answerVoiceDone
  430.   when action = 4 then signal stdfax
  431.   when action = 5 then signal stddata
  432.   when action = 8 then signal stdbusy
  433.   when action = 10 then do; number = ''; signal aagetnumberdone; end
  434.   when action = 12 then signal stdabort
  435.   when action = 14 then signal stderror
  436.   when action = 16 then signal stderror
  437.   otherwise signal arexxerror
  438. end
  439.  
  440. aagetnumberdone:
  441. /* We're done.  Number is in 'number' */
  442.  
  443. return number
  444.  
  445.  
  446. /* TITLE: avm:rexx/playnumber.avm */
  447. playnumber:
  448. /* Cycle through value and play each symbol */
  449.  
  450. procedure
  451. parse arg number
  452. say 'playnumber' number
  453.  
  454. do i = 1 to length(number)
  455.   if pos(substr(number, i, 1), '0123456789') > 0 then
  456.     call playnumbranch('playnum' || substr(number, i, 1))
  457.   else if substr(number, i, 1) = '#' then
  458.     call playnumbranch('playnumpound')
  459.   else if substr(number, i, 1) = '*' then
  460.     call playnumbranch('playnumstar')
  461. end
  462. signal playnumdone
  463.  
  464. playnumbranch:
  465. procedure
  466. parse arg label
  467. signal value label
  468. return
  469.  
  470. playnum0:
  471. 'playvoice' 'avm:voices/number00'
  472. action = rc
  473. select
  474.   when action = 0 then nop
  475.   when action = 1 then nop
  476.   when action = 4 then signal stdfax
  477.   when action = 5 then signal stddata
  478.   when action = 8 then signal stdbusy
  479.   when action = 12 then signal stdabort
  480.   when action = 14 then signal stderror
  481.   when action = 16 then signal stderror
  482.   otherwise signal arexxerror
  483. end
  484. return
  485.  
  486. playnum1:
  487. 'playvoice' 'avm:voices/number01'
  488. action = rc
  489. select
  490.   when action = 0 then nop
  491.   when action = 1 then nop
  492.   when action = 4 then signal stdfax
  493.   when action = 5 then signal stddata
  494.   when action = 8 then signal stdbusy
  495.   when action = 12 then signal stdabort
  496.   when action = 14 then signal stderror
  497.   when action = 16 then signal stderror
  498.   otherwise signal arexxerror
  499. end
  500. return
  501.  
  502. playnum2:
  503. 'playvoice' 'avm:voices/number02'
  504. action = rc
  505. select
  506.   when action = 0 then nop
  507.   when action = 1 then nop
  508.   when action = 4 then signal stdfax
  509.   when action = 5 then signal stddata
  510.   when action = 8 then signal stdbusy
  511.   when action = 12 then signal stdabort
  512.   when action = 14 then signal stderror
  513.   when action = 16 then signal stderror
  514.   otherwise signal arexxerror
  515. end
  516. return
  517.  
  518. playnum3:
  519. 'playvoice' 'avm:voices/number03'
  520. action = rc
  521. select
  522.   when action = 0 then nop
  523.   when action = 1 then nop
  524.   when action = 4 then signal stdfax
  525.   when action = 5 then signal stddata
  526.   when action = 8 then signal stdbusy
  527.   when action = 12 then signal stdabort
  528.   when action = 14 then signal stderror
  529.   when action = 16 then signal stderror
  530.   otherwise signal arexxerror
  531. end
  532. return
  533.  
  534. playnum4:
  535. 'playvoice' 'avm:voices/number04'
  536. action = rc
  537. select
  538.   when action = 0 then nop
  539.   when action = 1 then nop
  540.   when action = 4 then signal stdfax
  541.   when action = 5 then signal stddata
  542.   when action = 8 then signal stdbusy
  543.   when action = 12 then signal stdabort
  544.   when action = 14 then signal stderror
  545.   when action = 16 then signal stderror
  546.   otherwise signal arexxerror
  547. end
  548. return
  549.  
  550. playnum5:
  551. 'playvoice' 'avm:voices/number05'
  552. action = rc
  553. select
  554.   when action = 0 then nop
  555.   when action = 1 then nop
  556.   when action = 4 then signal stdfax
  557.   when action = 5 then signal stddata
  558.   when action = 8 then signal stdbusy
  559.   when action = 12 then signal stdabort
  560.   when action = 14 then signal stderror
  561.   when action = 16 then signal stderror
  562.   otherwise signal arexxerror
  563. end
  564. return
  565.  
  566. playnum6:
  567. 'playvoice' 'avm:voices/number06'
  568. action = rc
  569. select
  570.   when action = 0 then nop
  571.   when action = 1 then nop
  572.   when action = 4 then signal stdfax
  573.   when action = 5 then signal stddata
  574.   when action = 8 then signal stdbusy
  575.   when action = 12 then signal stdabort
  576.   when action = 14 then signal stderror
  577.   when action = 16 then signal stderror
  578.   otherwise signal arexxerror
  579. end
  580. return
  581.  
  582. playnum7:
  583. 'playvoice' 'avm:voices/number07'
  584. action = rc
  585. select
  586.   when action = 0 then nop
  587.   when action = 1 then nop
  588.   when action = 4 then signal stdfax
  589.   when action = 5 then signal stddata
  590.   when action = 8 then signal stdbusy
  591.   when action = 12 then signal stdabort
  592.   when action = 14 then signal stderror
  593.   when action = 16 then signal stderror
  594.   otherwise signal arexxerror
  595. end
  596. return
  597.  
  598. playnum8:
  599. 'playvoice' 'avm:voices/number08'
  600. action = rc
  601. select
  602.   when action = 0 then nop
  603.   when action = 1 then nop
  604.   when action = 4 then signal stdfax
  605.   when action = 5 then signal stddata
  606.   when action = 8 then signal stdbusy
  607.   when action = 12 then signal stdabort
  608.   when action = 14 then signal stderror
  609.   when action = 16 then signal stderror
  610.   otherwise signal arexxerror
  611. end
  612. return
  613.  
  614. playnum9:
  615. 'playvoice' 'avm:voices/number09'
  616. action = rc
  617. select
  618.   when action = 0 then nop
  619.   when action = 1 then nop
  620.   when action = 4 then signal stdfax
  621.   when action = 5 then signal stddata
  622.   when action = 8 then signal stdbusy
  623.   when action = 12 then signal stdabort
  624.   when action = 14 then signal stderror
  625.   when action = 16 then signal stderror
  626.   otherwise signal arexxerror
  627. end
  628. return
  629.  
  630. playnumpound:
  631. 'playvoice' 'avm:voices/numberpound'
  632. action = rc
  633. select
  634.   when action = 0 then nop
  635.   when action = 1 then nop
  636.   when action = 4 then signal stdfax
  637.   when action = 5 then signal stddata
  638.   when action = 8 then signal stdbusy
  639.   when action = 12 then signal stdabort
  640.   when action = 14 then signal stderror
  641.   when action = 16 then signal stderror
  642.   otherwise signal arexxerror
  643. end
  644. return
  645.  
  646. playnumstar:
  647. 'playvoice' 'avm:voices/numberstar'
  648. action = rc
  649. select
  650.   when action = 0 then nop
  651.   when action = 1 then nop
  652.   when action = 4 then signal stdfax
  653.   when action = 5 then signal stddata
  654.   when action = 8 then signal stdbusy
  655.   when action = 12 then signal stdabort
  656.   when action = 14 then signal stderror
  657.   when action = 16 then signal stderror
  658.   otherwise signal arexxerror
  659. end
  660. return
  661.  
  662. playnumdone:
  663. /* We're done */
  664. return
  665.  
  666.  
  667. /* TITLE: avm:rexx/playddnumber.avm */
  668. playddnumber:
  669. /* We're going to play a double digit number */
  670.  
  671. procedure
  672. parse arg number
  673. directdd = getclip('AVMDirectDDNumber')
  674. if upper(directdd) = 'YES' then signal playdirectdd
  675.  
  676. if number > 9 & number < 20 then
  677.   call playnumbranch('playnum' || number)
  678. else if number >= 20 & number < 60 then do
  679.   units = number // 10
  680.   tens = number - units
  681.   call playnumbranch('playnum' || tens)
  682.   if units > 0 then call playnumbranch('playnum' || units)
  683. end; else
  684.   call playnumber(number)
  685. signal playddnumdone
  686.  
  687. playdirectdd:
  688. if number < 10 then call playnumber(number)
  689. else call playnumbranch('playnum' || number)
  690. signal playddnumdone
  691.  
  692. playnum10:
  693. 'playvoice' 'avm:voices/number10'
  694. action = rc
  695. select
  696.   when action = 0 then nop
  697.   when action = 1 then nop
  698.   when action = 4 then signal stdfax
  699.   when action = 5 then signal stddata
  700.   when action = 8 then signal stdbusy
  701.   when action = 12 then signal stdabort
  702.   when action = 14 then signal stderror
  703.   when action = 16 then signal stderror
  704.   otherwise signal arexxerror
  705. end
  706. return
  707.  
  708. playnum11:
  709. 'playvoice' 'avm:voices/number11'
  710. action = rc
  711. select
  712.   when action = 0 then nop
  713.   when action = 1 then nop
  714.   when action = 4 then signal stdfax
  715.   when action = 5 then signal stddata
  716.   when action = 8 then signal stdbusy
  717.   when action = 12 then signal stdabort
  718.   when action = 14 then signal stderror
  719.   when action = 16 then signal stderror
  720.   otherwise signal arexxerror
  721. end
  722. return
  723.  
  724. playnum12:
  725. 'playvoice' 'avm:voices/number12'
  726. action = rc
  727. select
  728.   when action = 0 then nop
  729.   when action = 1 then nop
  730.   when action = 4 then signal stdfax
  731.   when action = 5 then signal stddata
  732.   when action = 8 then signal stdbusy
  733.   when action = 12 then signal stdabort
  734.   when action = 14 then signal stderror
  735.   when action = 16 then signal stderror
  736.   otherwise signal arexxerror
  737. end
  738. return
  739.  
  740. playnum13:
  741. 'playvoice' 'avm:voices/number13'
  742. action = rc
  743. select
  744.   when action = 0 then nop
  745.   when action = 1 then nop
  746.   when action = 4 then signal stdfax
  747.   when action = 5 then signal stddata
  748.   when action = 8 then signal stdbusy
  749.   when action = 12 then signal stdabort
  750.   when action = 14 then signal stderror
  751.   when action = 16 then signal stderror
  752.   otherwise signal arexxerror
  753. end
  754. return
  755.  
  756. playnum14:
  757. 'playvoice' 'avm:voices/number14'
  758. action = rc
  759. select
  760.   when action = 0 then nop
  761.   when action = 1 then nop
  762.   when action = 4 then signal stdfax
  763.   when action = 5 then signal stddata
  764.   when action = 8 then signal stdbusy
  765.   when action = 12 then signal stdabort
  766.   when action = 14 then signal stderror
  767.   when action = 16 then signal stderror
  768.   otherwise signal arexxerror
  769. end
  770. return
  771.  
  772. playnum15:
  773. 'playvoice' 'avm:voices/number15'
  774. action = rc
  775. select
  776.   when action = 0 then nop
  777.   when action = 1 then nop
  778.   when action = 4 then signal stdfax
  779.   when action = 5 then signal stddata
  780.   when action = 8 then signal stdbusy
  781.   when action = 12 then signal stdabort
  782.   when action = 14 then signal stderror
  783.   when action = 16 then signal stderror
  784.   otherwise signal arexxerror
  785. end
  786. return
  787.  
  788. playnum16:
  789. 'playvoice' 'avm:voices/number16'
  790. action = rc
  791. select
  792.   when action = 0 then nop
  793.   when action = 1 then nop
  794.   when action = 4 then signal stdfax
  795.   when action = 5 then signal stddata
  796.   when action = 8 then signal stdbusy
  797.   when action = 12 then signal stdabort
  798.   when action = 14 then signal stderror
  799.   when action = 16 then signal stderror
  800.   otherwise signal arexxerror
  801. end
  802. return
  803.  
  804. playnum17:
  805. 'playvoice' 'avm:voices/number17'
  806. action = rc
  807. select
  808.   when action = 0 then nop
  809.   when action = 1 then nop
  810.   when action = 4 then signal stdfax
  811.   when action = 5 then signal stddata
  812.   when action = 8 then signal stdbusy
  813.   when action = 12 then signal stdabort
  814.   when action = 14 then signal stderror
  815.   when action = 16 then signal stderror
  816.   otherwise signal arexxerror
  817. end
  818. return
  819.  
  820. playnum18:
  821. 'playvoice' 'avm:voices/number18'
  822. action = rc
  823. select
  824.   when action = 0 then nop
  825.   when action = 1 then nop
  826.   when action = 4 then signal stdfax
  827.   when action = 5 then signal stddata
  828.   when action = 8 then signal stdbusy
  829.   when action = 12 then signal stdabort
  830.   when action = 14 then signal stderror
  831.   when action = 16 then signal stderror
  832.   otherwise signal arexxerror
  833. end
  834. return
  835.  
  836. playnum19:
  837. 'playvoice' 'avm:voices/number19'
  838. action = rc
  839. select
  840.   when action = 0 then nop
  841.   when action = 1 then nop
  842.   when action = 4 then signal stdfax
  843.   when action = 5 then signal stddata
  844.   when action = 8 then signal stdbusy
  845.   when action = 12 then signal stdabort
  846.   when action = 14 then signal stderror
  847.   when action = 16 then signal stderror
  848.   otherwise signal arexxerror
  849. end
  850. return
  851.  
  852. playnum20:
  853. 'playvoice' 'avm:voices/number20'
  854. action = rc
  855. select
  856.   when action = 0 then nop
  857.   when action = 1 then nop
  858.   when action = 4 then signal stdfax
  859.   when action = 5 then signal stddata
  860.   when action = 8 then signal stdbusy
  861.   when action = 12 then signal stdabort
  862.   when action = 14 then signal stderror
  863.   when action = 16 then signal stderror
  864.   otherwise signal arexxerror
  865. end
  866. return
  867.  
  868. playnum30:
  869. 'playvoice' 'avm:voices/number30'
  870. action = rc
  871. select
  872.   when action = 0 then nop
  873.   when action = 1 then nop
  874.   when action = 4 then signal stdfax
  875.   when action = 5 then signal stddata
  876.   when action = 8 then signal stdbusy
  877.   when action = 12 then signal stdabort
  878.   when action = 14 then signal stderror
  879.   when action = 16 then signal stderror
  880.   otherwise signal arexxerror
  881. end
  882. return
  883.  
  884. playnum40:
  885. 'playvoice' 'avm:voices/number40'
  886. action = rc
  887. select
  888.   when action = 0 then nop
  889.   when action = 1 then nop
  890.   when action = 4 then signal stdfax
  891.   when action = 5 then signal stddata
  892.   when action = 8 then signal stdbusy
  893.   when action = 12 then signal stdabort
  894.   when action = 14 then signal stderror
  895.   when action = 16 then signal stderror
  896.   otherwise signal arexxerror
  897. end
  898. return
  899.  
  900. playnum50:
  901. 'playvoice' 'avm:voices/number50'
  902. action = rc
  903. select
  904.   when action = 0 then nop
  905.   when action = 1 then nop
  906.   when action = 4 then signal stdfax
  907.   when action = 5 then signal stddata
  908.   when action = 8 then signal stdbusy
  909.   when action = 12 then signal stdabort
  910.   when action = 14 then signal stderror
  911.   when action = 16 then signal stderror
  912.   otherwise signal arexxerror
  913. end
  914. return
  915.  
  916. playddnumdone:
  917. /* We're done */
  918. return
  919.  
  920. playnum21:
  921. 'playvoice' 'avm:voices/number21'
  922. action = rc
  923. select
  924.   when action = 0 then nop
  925.   when action = 1 then nop
  926.   when action = 4 then signal stdfax
  927.   when action = 5 then signal stddata
  928.   when action = 8 then signal stdbusy
  929.   when action = 12 then signal stdabort
  930.   when action = 14 then signal stderror
  931.   when action = 16 then signal stderror
  932.   otherwise signal arexxerror
  933. end
  934. return
  935.  
  936. playnum22:
  937. 'playvoice' 'avm:voices/number22'
  938. action = rc
  939. select
  940.   when action = 0 then nop
  941.   when action = 1 then nop
  942.   when action = 4 then signal stdfax
  943.   when action = 5 then signal stddata
  944.   when action = 8 then signal stdbusy
  945.   when action = 12 then signal stdabort
  946.   when action = 14 then signal stderror
  947.   when action = 16 then signal stderror
  948.   otherwise signal arexxerror
  949. end
  950. return
  951.  
  952. playnum23:
  953. 'playvoice' 'avm:voices/number23'
  954. action = rc
  955. select
  956.   when action = 0 then nop
  957.   when action = 1 then nop
  958.   when action = 4 then signal stdfax
  959.   when action = 5 then signal stddata
  960.   when action = 8 then signal stdbusy
  961.   when action = 12 then signal stdabort
  962.   when action = 14 then signal stderror
  963.   when action = 16 then signal stderror
  964.   otherwise signal arexxerror
  965. end
  966. return
  967.  
  968. playnum24:
  969. 'playvoice' 'avm:voices/number24'
  970. action = rc
  971. select
  972.   when action = 0 then nop
  973.   when action = 1 then nop
  974.   when action = 4 then signal stdfax
  975.   when action = 5 then signal stddata
  976.   when action = 8 then signal stdbusy
  977.   when action = 12 then signal stdabort
  978.   when action = 14 then signal stderror
  979.   when action = 16 then signal stderror
  980.   otherwise signal arexxerror
  981. end
  982. return
  983.  
  984. playnum25:
  985. 'playvoice' 'avm:voices/number25'
  986. action = rc
  987. select
  988.   when action = 0 then nop
  989.   when action = 1 then nop
  990.   when action = 4 then signal stdfax
  991.   when action = 5 then signal stddata
  992.   when action = 8 then signal stdbusy
  993.   when action = 12 then signal stdabort
  994.   when action = 14 then signal stderror
  995.   when action = 16 then signal stderror
  996.   otherwise signal arexxerror
  997. end
  998. return
  999.  
  1000. playnum26:
  1001. 'playvoice' 'avm:voices/number26'
  1002. action = rc
  1003. select
  1004.   when action = 0 then nop
  1005.   when action = 1 then nop
  1006.   when action = 4 then signal stdfax
  1007.   when action = 5 then signal stddata
  1008.   when action = 8 then signal stdbusy
  1009.   when action = 12 then signal stdabort
  1010.   when action = 14 then signal stderror
  1011.   when action = 16 then signal stderror
  1012.   otherwise signal arexxerror
  1013. end
  1014. return
  1015.  
  1016. playnum27:
  1017. 'playvoice' 'avm:voices/number27'
  1018. action = rc
  1019. select
  1020.   when action = 0 then nop
  1021.   when action = 1 then nop
  1022.   when action = 4 then signal stdfax
  1023.   when action = 5 then signal stddata
  1024.   when action = 8 then signal stdbusy
  1025.   when action = 12 then signal stdabort
  1026.   when action = 14 then signal stderror
  1027.   when action = 16 then signal stderror
  1028.   otherwise signal arexxerror
  1029. end
  1030. return
  1031.  
  1032. playnum28:
  1033. 'playvoice' 'avm:voices/number28'
  1034. action = rc
  1035. select
  1036.   when action = 0 then nop
  1037.   when action = 1 then nop
  1038.   when action = 4 then signal stdfax
  1039.   when action = 5 then signal stddata
  1040.   when action = 8 then signal stdbusy
  1041.   when action = 12 then signal stdabort
  1042.   when action = 14 then signal stderror
  1043.   when action = 16 then signal stderror
  1044.   otherwise signal arexxerror
  1045. end
  1046. return
  1047.  
  1048. playnum29:
  1049. 'playvoice' 'avm:voices/number29'
  1050. action = rc
  1051. select
  1052.   when action = 0 then nop
  1053.   when action = 1 then nop
  1054.   when action = 4 then signal stdfax
  1055.   when action = 5 then signal stddata
  1056.   when action = 8 then signal stdbusy
  1057.   when action = 12 then signal stdabort
  1058.   when action = 14 then signal stderror
  1059.   when action = 16 then signal stderror
  1060.   otherwise signal arexxerror
  1061. end
  1062. return
  1063.  
  1064. playnum31:
  1065. 'playvoice' 'avm:voices/number31'
  1066. action = rc
  1067. select
  1068.   when action = 0 then nop
  1069.   when action = 1 then nop
  1070.   when action = 4 then signal stdfax
  1071.   when action = 5 then signal stddata
  1072.   when action = 8 then signal stdbusy
  1073.   when action = 12 then signal stdabort
  1074.   when action = 14 then signal stderror
  1075.   when action = 16 then signal stderror
  1076.   otherwise signal arexxerror
  1077. end
  1078. return
  1079.  
  1080. playnum32:
  1081. 'playvoice' 'avm:voices/number32'
  1082. action = rc
  1083. select
  1084.   when action = 0 then nop
  1085.   when action = 1 then nop
  1086.   when action = 4 then signal stdfax
  1087.   when action = 5 then signal stddata
  1088.   when action = 8 then signal stdbusy
  1089.   when action = 12 then signal stdabort
  1090.   when action = 14 then signal stderror
  1091.   when action = 16 then signal stderror
  1092.   otherwise signal arexxerror
  1093. end
  1094. return
  1095.  
  1096. playnum33:
  1097. 'playvoice' 'avm:voices/number33'
  1098. action = rc
  1099. select
  1100.   when action = 0 then nop
  1101.   when action = 1 then nop
  1102.   when action = 4 then signal stdfax
  1103.   when action = 5 then signal stddata
  1104.   when action = 8 then signal stdbusy
  1105.   when action = 12 then signal stdabort
  1106.   when action = 14 then signal stderror
  1107.   when action = 16 then signal stderror
  1108.   otherwise signal arexxerror
  1109. end
  1110. return
  1111.  
  1112. playnum34:
  1113. 'playvoice' 'avm:voices/number34'
  1114. action = rc
  1115. select
  1116.   when action = 0 then nop
  1117.   when action = 1 then nop
  1118.   when action = 4 then signal stdfax
  1119.   when action = 5 then signal stddata
  1120.   when action = 8 then signal stdbusy
  1121.   when action = 12 then signal stdabort
  1122.   when action = 14 then signal stderror
  1123.   when action = 16 then signal stderror
  1124.   otherwise signal arexxerror
  1125. end
  1126. return
  1127.  
  1128. playnum35:
  1129. 'playvoice' 'avm:voices/number35'
  1130. action = rc
  1131. select
  1132.   when action = 0 then nop
  1133.   when action = 1 then nop
  1134.   when action = 4 then signal stdfax
  1135.   when action = 5 then signal stddata
  1136.   when action = 8 then signal stdbusy
  1137.   when action = 12 then signal stdabort
  1138.   when action = 14 then signal stderror
  1139.   when action = 16 then signal stderror
  1140.   otherwise signal arexxerror
  1141. end
  1142. return
  1143.  
  1144. playnum36:
  1145. 'playvoice' 'avm:voices/number36'
  1146. action = rc
  1147. select
  1148.   when action = 0 then nop
  1149.   when action = 1 then nop
  1150.   when action = 4 then signal stdfax
  1151.   when action = 5 then signal stddata
  1152.   when action = 8 then signal stdbusy
  1153.   when action = 12 then signal stdabort
  1154.   when action = 14 then signal stderror
  1155.   when action = 16 then signal stderror
  1156.   otherwise signal arexxerror
  1157. end
  1158. return
  1159.  
  1160. playnum37:
  1161. 'playvoice' 'avm:voices/number37'
  1162. action = rc
  1163. select
  1164.   when action = 0 then nop
  1165.   when action = 1 then nop
  1166.   when action = 4 then signal stdfax
  1167.   when action = 5 then signal stddata
  1168.   when action = 8 then signal stdbusy
  1169.   when action = 12 then signal stdabort
  1170.   when action = 14 then signal stderror
  1171.   when action = 16 then signal stderror
  1172.   otherwise signal arexxerror
  1173. end
  1174. return
  1175.  
  1176. playnum38:
  1177. 'playvoice' 'avm:voices/number38'
  1178. action = rc
  1179. select
  1180.   when action = 0 then nop
  1181.   when action = 1 then nop
  1182.   when action = 4 then signal stdfax
  1183.   when action = 5 then signal stddata
  1184.   when action = 8 then signal stdbusy
  1185.   when action = 12 then signal stdabort
  1186.   when action = 14 then signal stderror
  1187.   when action = 16 then signal stderror
  1188.   otherwise signal arexxerror
  1189. end
  1190. return
  1191.  
  1192. playnum39:
  1193. 'playvoice' 'avm:voices/number39'
  1194. action = rc
  1195. select
  1196.   when action = 0 then nop
  1197.   when action = 1 then nop
  1198.   when action = 4 then signal stdfax
  1199.   when action = 5 then signal stddata
  1200.   when action = 8 then signal stdbusy
  1201.   when action = 12 then signal stdabort
  1202.   when action = 14 then signal stderror
  1203.   when action = 16 then signal stderror
  1204.   otherwise signal arexxerror
  1205. end
  1206. return
  1207.  
  1208. playnum41:
  1209. 'playvoice' 'avm:voices/number41'
  1210. action = rc
  1211. select
  1212.   when action = 0 then nop
  1213.   when action = 1 then nop
  1214.   when action = 4 then signal stdfax
  1215.   when action = 5 then signal stddata
  1216.   when action = 8 then signal stdbusy
  1217.   when action = 12 then signal stdabort
  1218.   when action = 14 then signal stderror
  1219.   when action = 16 then signal stderror
  1220.   otherwise signal arexxerror
  1221. end
  1222. return
  1223.  
  1224. playnum42:
  1225. 'playvoice' 'avm:voices/number42'
  1226. action = rc
  1227. select
  1228.   when action = 0 then nop
  1229.   when action = 1 then nop
  1230.   when action = 4 then signal stdfax
  1231.   when action = 5 then signal stddata
  1232.   when action = 8 then signal stdbusy
  1233.   when action = 12 then signal stdabort
  1234.   when action = 14 then signal stderror
  1235.   when action = 16 then signal stderror
  1236.   otherwise signal arexxerror
  1237. end
  1238. return
  1239.  
  1240. playnum43:
  1241. 'playvoice' 'avm:voices/number43'
  1242. action = rc
  1243. select
  1244.   when action = 0 then nop
  1245.   when action = 1 then nop
  1246.   when action = 4 then signal stdfax
  1247.   when action = 5 then signal stddata
  1248.   when action = 8 then signal stdbusy
  1249.   when action = 12 then signal stdabort
  1250.   when action = 14 then signal stderror
  1251.   when action = 16 then signal stderror
  1252.   otherwise signal arexxerror
  1253. end
  1254. return
  1255.  
  1256. playnum44:
  1257. 'playvoice' 'avm:voices/number44'
  1258. action = rc
  1259. select
  1260.   when action = 0 then nop
  1261.   when action = 1 then nop
  1262.   when action = 4 then signal stdfax
  1263.   when action = 5 then signal stddata
  1264.   when action = 8 then signal stdbusy
  1265.   when action = 12 then signal stdabort
  1266.   when action = 14 then signal stderror
  1267.   when action = 16 then signal stderror
  1268.   otherwise signal arexxerror
  1269. end
  1270. return
  1271.  
  1272. playnum45:
  1273. 'playvoice' 'avm:voices/number45'
  1274. action = rc
  1275. select
  1276.   when action = 0 then nop
  1277.   when action = 1 then nop
  1278.   when action = 4 then signal stdfax
  1279.   when action = 5 then signal stddata
  1280.   when action = 8 then signal stdbusy
  1281.   when action = 12 then signal stdabort
  1282.   when action = 14 then signal stderror
  1283.   when action = 16 then signal stderror
  1284.   otherwise signal arexxerror
  1285. end
  1286. return
  1287.  
  1288. playnum46:
  1289. 'playvoice' 'avm:voices/number46'
  1290. action = rc
  1291. select
  1292.   when action = 0 then nop
  1293.   when action = 1 then nop
  1294.   when action = 4 then signal stdfax
  1295.   when action = 5 then signal stddata
  1296.   when action = 8 then signal stdbusy
  1297.   when action = 12 then signal stdabort
  1298.   when action = 14 then signal stderror
  1299.   when action = 16 then signal stderror
  1300.   otherwise signal arexxerror
  1301. end
  1302. return
  1303.  
  1304. playnum47:
  1305. 'playvoice' 'avm:voices/number47'
  1306. action = rc
  1307. select
  1308.   when action = 0 then nop
  1309.   when action = 1 then nop
  1310.   when action = 4 then signal stdfax
  1311.   when action = 5 then signal stddata
  1312.   when action = 8 then signal stdbusy
  1313.   when action = 12 then signal stdabort
  1314.   when action = 14 then signal stderror
  1315.   when action = 16 then signal stderror
  1316.   otherwise signal arexxerror
  1317. end
  1318. return
  1319.  
  1320. playnum48:
  1321. 'playvoice' 'avm:voices/number48'
  1322. action = rc
  1323. select
  1324.   when action = 0 then nop
  1325.   when action = 1 then nop
  1326.   when action = 4 then signal stdfax
  1327.   when action = 5 then signal stddata
  1328.   when action = 8 then signal stdbusy
  1329.   when action = 12 then signal stdabort
  1330.   when action = 14 then signal stderror
  1331.   when action = 16 then signal stderror
  1332.   otherwise signal arexxerror
  1333. end
  1334. return
  1335.  
  1336. playnum49:
  1337. 'playvoice' 'avm:voices/number49'
  1338. action = rc
  1339. select
  1340.   when action = 0 then nop
  1341.   when action = 1 then nop
  1342.   when action = 4 then signal stdfax
  1343.   when action = 5 then signal stddata
  1344.   when action = 8 then signal stdbusy
  1345.   when action = 12 then signal stdabort
  1346.   when action = 14 then signal stderror
  1347.   when action = 16 then signal stderror
  1348.   otherwise signal arexxerror
  1349. end
  1350. return
  1351.  
  1352. playnum51:
  1353. 'playvoice' 'avm:voices/number51'
  1354. action = rc
  1355. select
  1356.   when action = 0 then nop
  1357.   when action = 1 then nop
  1358.   when action = 4 then signal stdfax
  1359.   when action = 5 then signal stddata
  1360.   when action = 8 then signal stdbusy
  1361.   when action = 12 then signal stdabort
  1362.   when action = 14 then signal stderror
  1363.   when action = 16 then signal stderror
  1364.   otherwise signal arexxerror
  1365. end
  1366. return
  1367.  
  1368. playnum52:
  1369. 'playvoice' 'avm:voices/number52'
  1370. action = rc
  1371. select
  1372.   when action = 0 then nop
  1373.   when action = 1 then nop
  1374.   when action = 4 then signal stdfax
  1375.   when action = 5 then signal stddata
  1376.   when action = 8 then signal stdbusy
  1377.   when action = 12 then signal stdabort
  1378.   when action = 14 then signal stderror
  1379.   when action = 16 then signal stderror
  1380.   otherwise signal arexxerror
  1381. end
  1382. return
  1383.  
  1384. playnum53:
  1385. 'playvoice' 'avm:voices/number53'
  1386. action = rc
  1387. select
  1388.   when action = 0 then nop
  1389.   when action = 1 then nop
  1390.   when action = 4 then signal stdfax
  1391.   when action = 5 then signal stddata
  1392.   when action = 8 then signal stdbusy
  1393.   when action = 12 then signal stdabort
  1394.   when action = 14 then signal stderror
  1395.   when action = 16 then signal stderror
  1396.   otherwise signal arexxerror
  1397. end
  1398. return
  1399.  
  1400. playnum54:
  1401. 'playvoice' 'avm:voices/number54'
  1402. action = rc
  1403. select
  1404.   when action = 0 then nop
  1405.   when action = 1 then nop
  1406.   when action = 4 then signal stdfax
  1407.   when action = 5 then signal stddata
  1408.   when action = 8 then signal stdbusy
  1409.   when action = 12 then signal stdabort
  1410.   when action = 14 then signal stderror
  1411.   when action = 16 then signal stderror
  1412.   otherwise signal arexxerror
  1413. end
  1414. return
  1415.  
  1416. playnum55:
  1417. 'playvoice' 'avm:voices/number55'
  1418. action = rc
  1419. select
  1420.   when action = 0 then nop
  1421.   when action = 1 then nop
  1422.   when action = 4 then signal stdfax
  1423.   when action = 5 then signal stddata
  1424.   when action = 8 then signal stdbusy
  1425.   when action = 12 then signal stdabort
  1426.   when action = 14 then signal stderror
  1427.   when action = 16 then signal stderror
  1428.   otherwise signal arexxerror
  1429. end
  1430. return
  1431.  
  1432. playnum56:
  1433. 'playvoice' 'avm:voices/number56'
  1434. action = rc
  1435. select
  1436.   when action = 0 then nop
  1437.   when action = 1 then nop
  1438.   when action = 4 then signal stdfax
  1439.   when action = 5 then signal stddata
  1440.   when action = 8 then signal stdbusy
  1441.   when action = 12 then signal stdabort
  1442.   when action = 14 then signal stderror
  1443.   when action = 16 then signal stderror
  1444.   otherwise signal arexxerror
  1445. end
  1446. return
  1447.  
  1448. playnum57:
  1449. 'playvoice' 'avm:voices/number57'
  1450. action = rc
  1451. select
  1452.   when action = 0 then nop
  1453.   when action = 1 then nop
  1454.   when action = 4 then signal stdfax
  1455.   when action = 5 then signal stddata
  1456.   when action = 8 then signal stdbusy
  1457.   when action = 12 then signal stdabort
  1458.   when action = 14 then signal stderror
  1459.   when action = 16 then signal stderror
  1460.   otherwise signal arexxerror
  1461. end
  1462. return
  1463.  
  1464. playnum58:
  1465. 'playvoice' 'avm:voices/number58'
  1466. action = rc
  1467. select
  1468.   when action = 0 then nop
  1469.   when action = 1 then nop
  1470.   when action = 4 then signal stdfax
  1471.   when action = 5 then signal stddata
  1472.   when action = 8 then signal stdbusy
  1473.   when action = 12 then signal stdabort
  1474.   when action = 14 then signal stderror
  1475.   when action = 16 then signal stderror
  1476.   otherwise signal arexxerror
  1477. end
  1478. return
  1479.  
  1480. playnum59:
  1481. 'playvoice' 'avm:voices/number59'
  1482. action = rc
  1483. select
  1484.   when action = 0 then nop
  1485.   when action = 1 then nop
  1486.   when action = 4 then signal stdfax
  1487.   when action = 5 then signal stddata
  1488.   when action = 8 then signal stdbusy
  1489.   when action = 12 then signal stdabort
  1490.   when action = 14 then signal stderror
  1491.   when action = 16 then signal stderror
  1492.   otherwise signal arexxerror
  1493. end
  1494. return
  1495.  
  1496.  
  1497. /* TITLE: avm:rexx/playtime.avm */
  1498. playtime:
  1499. procedure
  1500. parse arg secs
  1501. hours = secs % (60*60)
  1502. minutes = (secs - (hours * 60 * 60)) % 60
  1503. if hours < 12 then pm = 0
  1504. else do; pm = 1; hours = hours - 12; end
  1505. if hours = 0 then hours = 12
  1506. timeformat = getclip('AVMTimeFormat')
  1507. if timeformat = "" then timeformat = '%hours12 %minutes %pm'
  1508.  
  1509. do i = 1 to words(timeformat)
  1510.   if upper(word(timeformat, i)) = '%HOURS12' then
  1511.     call playddnumber(hours)
  1512.   else if upper(word(timeformat, i)) = '%HOURS24' then
  1513.     call playddnumber(hours + (pm * 12))
  1514.   else if upper(word(timeformat, i)) = '%MINUTES' then
  1515.     call playddnumber(minutes)
  1516.   else if upper(word(timeformat, i)) = '%PM' then
  1517.     do
  1518.  
  1519.       if pm then call playnumbranch('playtimepm')
  1520.       else call playnumbranch('playtimeam')
  1521.     end
  1522.   else
  1523.     call playddvoice(word(timeformat, i))
  1524. end
  1525.  
  1526. /* We're done */
  1527. return
  1528.  
  1529. playtimeam:
  1530. 'playvoice' 'avm:voices/timeam'
  1531. action = rc
  1532. select
  1533.   when action = 0 then nop
  1534.   when action = 1 then nop
  1535.   when action = 4 then signal stdfax
  1536.   when action = 5 then signal stddata
  1537.   when action = 8 then signal stdbusy
  1538.   when action = 12 then signal stdabort
  1539.   when action = 14 then signal stderror
  1540.   when action = 16 then signal stderror
  1541.   otherwise signal arexxerror
  1542. end
  1543. return
  1544.  
  1545. playtimepm:
  1546. 'playvoice' 'avm:voices/timepm'
  1547. action = rc
  1548. select
  1549.   when action = 0 then nop
  1550.   when action = 1 then nop
  1551.   when action = 4 then signal stdfax
  1552.   when action = 5 then signal stddata
  1553.   when action = 8 then signal stdbusy
  1554.   when action = 12 then signal stdabort
  1555.   when action = 14 then signal stderror
  1556.   when action = 16 then signal stderror
  1557.   otherwise signal arexxerror
  1558. end
  1559. return
  1560.  
  1561.  
  1562. /* TITLE: avm:rexx/playdate.avm */
  1563. playdate:
  1564. /* We're going to play the month and day */
  1565.  
  1566. procedure
  1567. parse arg actualDate
  1568.  
  1569. dateformat = getclip('AVMDateFormat')
  1570. if dateformat = "" then dateformat = "%month %day"
  1571. else if upper(dateformat) = "NONE" then dateformat = ""
  1572.  
  1573. do i = 1 to words(dateformat)
  1574.   if upper(word(dateformat, i)) = "%MONTH" then
  1575.     call playnumbranch('playdate' || substr(actualDate, 5, 2))
  1576.   else if upper(word(dateformat, i)) = "%DAY" then
  1577.     call playddnumber(substr(actualDate, 7, 2))
  1578.   else
  1579.     call playddvoice(word(dateformat, i))
  1580. end
  1581.  
  1582. /* We're done */
  1583. return
  1584.  
  1585. playddvoice:
  1586. procedure
  1587. parse arg filename
  1588.  
  1589. 'playvoice' filename
  1590. action = rc
  1591. select
  1592.   when action = 0 then nop
  1593.   when action = 1 then nop
  1594.   when action = 4 then signal stdfax
  1595.   when action = 5 then signal stddata
  1596.   when action = 8 then signal stdbusy
  1597.   when action = 12 then signal stdabort
  1598.   when action = 14 then signal stderror
  1599.   when action = 16 then signal stderror
  1600.   otherwise signal arexxerror
  1601. end
  1602. return
  1603.  
  1604. playdate01:
  1605. 'playvoice' 'avm:voices/monthjanuary'
  1606. action = rc
  1607. select
  1608.   when action = 0 then nop
  1609.   when action = 1 then nop
  1610.   when action = 4 then signal stdfax
  1611.   when action = 5 then signal stddata
  1612.   when action = 8 then signal stdbusy
  1613.   when action = 12 then signal stdabort
  1614.   when action = 14 then signal stderror
  1615.   when action = 16 then signal stderror
  1616.   otherwise signal arexxerror
  1617. end
  1618. return
  1619.  
  1620. playdate02:
  1621. 'playvoice' 'avm:voices/monthfebruary'
  1622. action = rc
  1623. select
  1624.   when action = 0 then nop
  1625.   when action = 1 then nop
  1626.   when action = 4 then signal stdfax
  1627.   when action = 5 then signal stddata
  1628.   when action = 8 then signal stdbusy
  1629.   when action = 12 then signal stdabort
  1630.   when action = 14 then signal stderror
  1631.   when action = 16 then signal stderror
  1632.   otherwise signal arexxerror
  1633. end
  1634. return
  1635.  
  1636. playdate03:
  1637. 'playvoice' 'avm:voices/monthmarch'
  1638. action = rc
  1639. select
  1640.   when action = 0 then nop
  1641.   when action = 1 then nop
  1642.   when action = 4 then signal stdfax
  1643.   when action = 5 then signal stddata
  1644.   when action = 8 then signal stdbusy
  1645.   when action = 12 then signal stdabort
  1646.   when action = 14 then signal stderror
  1647.   when action = 16 then signal stderror
  1648.   otherwise signal arexxerror
  1649. end
  1650. return
  1651.  
  1652. playdate04:
  1653. 'playvoice' 'avm:voices/monthapril'
  1654. action = rc
  1655. select
  1656.   when action = 0 then nop
  1657.   when action = 1 then nop
  1658.   when action = 4 then signal stdfax
  1659.   when action = 5 then signal stddata
  1660.   when action = 8 then signal stdbusy
  1661.   when action = 12 then signal stdabort
  1662.   when action = 14 then signal stderror
  1663.   when action = 16 then signal stderror
  1664.   otherwise signal arexxerror
  1665. end
  1666. return
  1667.  
  1668. playdate05:
  1669. 'playvoice' 'avm:voices/monthmay'
  1670. action = rc
  1671. select
  1672.   when action = 0 then nop
  1673.   when action = 1 then nop
  1674.   when action = 4 then signal stdfax
  1675.   when action = 5 then signal stddata
  1676.   when action = 8 then signal stdbusy
  1677.   when action = 12 then signal stdabort
  1678.   when action = 14 then signal stderror
  1679.   when action = 16 then signal stderror
  1680.   otherwise signal arexxerror
  1681. end
  1682. return
  1683.  
  1684. playdate06:
  1685. 'playvoice' 'avm:voices/monthjune'
  1686. action = rc
  1687. select
  1688.   when action = 0 then nop
  1689.   when action = 1 then nop
  1690.   when action = 4 then signal stdfax
  1691.   when action = 5 then signal stddata
  1692.   when action = 8 then signal stdbusy
  1693.   when action = 12 then signal stdabort
  1694.   when action = 14 then signal stderror
  1695.   when action = 16 then signal stderror
  1696.   otherwise signal arexxerror
  1697. end
  1698. return
  1699.  
  1700. playdate07:
  1701. 'playvoice' 'avm:voices/monthjuly'
  1702. action = rc
  1703. select
  1704.   when action = 0 then nop
  1705.   when action = 1 then nop
  1706.   when action = 4 then signal stdfax
  1707.   when action = 5 then signal stddata
  1708.   when action = 8 then signal stdbusy
  1709.   when action = 12 then signal stdabort
  1710.   when action = 14 then signal stderror
  1711.   when action = 16 then signal stderror
  1712.   otherwise signal arexxerror
  1713. end
  1714. return
  1715.  
  1716. playdate08:
  1717. 'playvoice' 'avm:voices/monthaugust'
  1718. action = rc
  1719. select
  1720.   when action = 0 then nop
  1721.   when action = 1 then nop
  1722.   when action = 4 then signal stdfax
  1723.   when action = 5 then signal stddata
  1724.   when action = 8 then signal stdbusy
  1725.   when action = 12 then signal stdabort
  1726.   when action = 14 then signal stderror
  1727.   when action = 16 then signal stderror
  1728.   otherwise signal arexxerror
  1729. end
  1730. return
  1731.  
  1732. playdate09:
  1733. 'playvoice' 'avm:voices/monthseptember'
  1734. action = rc
  1735. select
  1736.   when action = 0 then nop
  1737.   when action = 1 then nop
  1738.   when action = 4 then signal stdfax
  1739.   when action = 5 then signal stddata
  1740.   when action = 8 then signal stdbusy
  1741.   when action = 12 then signal stdabort
  1742.   when action = 14 then signal stderror
  1743.   when action = 16 then signal stderror
  1744.   otherwise signal arexxerror
  1745. end
  1746. return
  1747.  
  1748. playdate10:
  1749. 'playvoice' 'avm:voices/monthoctober'
  1750. action = rc
  1751. select
  1752.   when action = 0 then nop
  1753.   when action = 1 then nop
  1754.   when action = 4 then signal stdfax
  1755.   when action = 5 then signal stddata
  1756.   when action = 8 then signal stdbusy
  1757.   when action = 12 then signal stdabort
  1758.   when action = 14 then signal stderror
  1759.   when action = 16 then signal stderror
  1760.   otherwise signal arexxerror
  1761. end
  1762. return
  1763.  
  1764. playdate11:
  1765. 'playvoice' 'avm:voices/monthnovember'
  1766. action = rc
  1767. select
  1768.   when action = 0 then nop
  1769.   when action = 1 then nop
  1770.   when action = 4 then signal stdfax
  1771.   when action = 5 then signal stddata
  1772.   when action = 8 then signal stdbusy
  1773.   when action = 12 then signal stdabort
  1774.   when action = 14 then signal stderror
  1775.   when action = 16 then signal stderror
  1776.   otherwise signal arexxerror
  1777. end
  1778. return
  1779.  
  1780. playdate12:
  1781. 'playvoice' 'avm:voices/monthdecember'
  1782. action = rc
  1783. select
  1784.   when action = 0 then nop
  1785.   when action = 1 then nop
  1786.   when action = 4 then signal stdfax
  1787.   when action = 5 then signal stddata
  1788.   when action = 8 then signal stdbusy
  1789.   when action = 12 then signal stdabort
  1790.   when action = 14 then signal stderror
  1791.   when action = 16 then signal stderror
  1792.   otherwise signal arexxerror
  1793. end
  1794. return
  1795.  
  1796.  
  1797. /* TITLE: avm:rexx/recordmessage.avm */
  1798. recordmessage:
  1799. procedure
  1800. parse arg filename
  1801.  
  1802. recordmessagesagain:
  1803. call aapresentmenu('avm:voices/RecordMessage', '0123#*', '3')
  1804. action = result
  1805. select
  1806.   when action = '=0' then signal recordmessageagain
  1807.   when action = '=1' then signal recordmessagesplay
  1808.   when action = '=2' then signal recordmessagesrecord
  1809.   when action = '=3' then signal recordmessagesdelete
  1810.   when action = '=4' then nop
  1811.   when action = '=5' then nop
  1812.   when action = '=6' then nop
  1813.   when action = '=7' then nop
  1814.   when action = '=8' then nop
  1815.   when action = '=9' then nop
  1816.   when action = '=#' then do; nop; end
  1817.   when action = '=*' then signal answerVoiceDone
  1818.   when action = 4 then signal stdfax
  1819.   when action = 5 then signal stddata
  1820.   when action = 8 then signal stdbusy
  1821.   when action = 10 then signal answerVoiceDone
  1822.   when action = 12 then signal stdabort
  1823.   when action = 14 then signal stderror
  1824.   when action = 16 then signal stderror
  1825.   otherwise signal arexxerror
  1826. end
  1827. return
  1828.  
  1829. recordmessagesplay:
  1830. 'playbeep' '3000' '0' '4'
  1831. action = rc
  1832. select
  1833.   when action = 0 then nop
  1834.   when action = 1 then nop
  1835.   when action = 4 then signal stdfax
  1836.   when action = 5 then signal stddata
  1837.   when action = 8 then signal stdbusy
  1838.   when action = 12 then signal stdabort
  1839.   when action = 14 then signal stderror
  1840.   when action = 16 then signal stderror
  1841.   otherwise signal arexxerror
  1842. end
  1843.  
  1844. 'playvoice' filename
  1845. action = rc
  1846. select
  1847.   when action = 0 then nop
  1848.   when action = 1 then nop
  1849.   when action = 4 then signal stdfax
  1850.   when action = 5 then signal stddata
  1851.   when action = 8 then signal stdbusy
  1852.   when action = 12 then signal stdabort
  1853.   when action = 14 then nop
  1854.   when action = 16 then nop
  1855.   otherwise signal arexxerror
  1856. end
  1857.  
  1858. 'flushphonebuffer'
  1859.  
  1860. 'playbeep' '3000' '0' '4'
  1861. action = rc
  1862. select
  1863.   when action = 0 then nop
  1864.   when action = 1 then nop
  1865.   when action = 4 then signal stdfax
  1866.   when action = 5 then signal stddata
  1867.   when action = 8 then signal stdbusy
  1868.   when action = 12 then signal stdabort
  1869.   when action = 14 then signal stderror
  1870.   when action = 16 then signal stderror
  1871.   otherwise signal arexxerror
  1872. end
  1873. signal recordmessagesagain
  1874.  
  1875. recordmessagesrecord:
  1876. 'playvoice' 'avm:voices/RecordMessagesRecord'
  1877. action = rc
  1878. select
  1879.   when action = 0 then nop
  1880.   when action = 1 then nop
  1881.   when action = 4 then signal stdfax
  1882.   when action = 5 then signal stddata
  1883.   when action = 8 then signal stdbusy
  1884.   when action = 12 then signal stdabort
  1885.   when action = 14 then signal stderror
  1886.   when action = 16 then signal stderror
  1887.   otherwise signal arexxerror
  1888. end
  1889.  
  1890. 'playbeep' '3000' '0' '4'
  1891. action = rc
  1892. select
  1893.   when action = 0 then nop
  1894.   when action = 1 then nop
  1895.   when action = 4 then signal stdfax
  1896.   when action = 5 then signal stddata
  1897.   when action = 8 then signal stdbusy
  1898.   when action = 12 then signal stdabort
  1899.   when action = 14 then signal stderror
  1900.   when action = 16 then signal stderror
  1901.   otherwise signal arexxerror
  1902. end
  1903.  
  1904. 'recordvoice' '0' '-1' '30' filename
  1905. action = rc
  1906. select
  1907.   when action = 0 then nop
  1908.   when action = 1 then nop
  1909.   when action = 2 then nop
  1910.   when action = 3 then nop
  1911.   when action = 4 then signal stdfax
  1912.   when action = 5 then signal stddata
  1913.   when action = 8 then signal stdbusy
  1914.   when action = 10 then nop
  1915.   when action = 12 then signal stdabort
  1916.   when action = 14 then signal stderror
  1917.   when action = 16 then signal stderror
  1918.   otherwise signal arexxerror
  1919. end
  1920.  
  1921. 'flushphonebuffer'
  1922.  
  1923. 'playbeep' '3000' '0' '4'
  1924. action = rc
  1925. select
  1926.   when action = 0 then nop
  1927.   when action = 1 then nop
  1928.   when action = 4 then signal stdfax
  1929.   when action = 5 then signal stddata
  1930.   when action = 8 then signal stdbusy
  1931.   when action = 12 then signal stdabort
  1932.   when action = 14 then signal stderror
  1933.   when action = 16 then signal stderror
  1934.   otherwise signal arexxerror
  1935. end
  1936. signal recordmessagesagain
  1937.  
  1938. recordmessagesdelete:
  1939. address command 'delete >nil: <nil: quiet' filename
  1940. signal recordmessagesagain
  1941.  
  1942.  
  1943. aapresentmenu:
  1944. /* TITLE: avm:rexx/presentmenu.avm */
  1945. procedure expose pmRetries pmTimesAround
  1946. parse arg filename, valid, retries
  1947. timesaround = retries
  1948. pmTimesAround = timesaround
  1949. pmRetries = retries
  1950.  
  1951. rs.normal = 0
  1952. rs.keydetected = 1
  1953. rs.quietdetected = 2
  1954. rs.silencedetected = 3
  1955. rs.faxdetected = 4
  1956. rs.datadetected = 5
  1957. rs.busydetected = 8
  1958. rs.timedout = 10
  1959. rs.signaldetected = 12
  1960. rs.overflow = 14
  1961. rs.error = 16
  1962. /* CB 0000 */
  1963.  
  1964. aapresentmenuloop:
  1965. 'playvoice' filename
  1966. action = rc
  1967. select
  1968.   when action = 0 then nop
  1969.   when action = 1 then nop
  1970.   when action = 4 then do; return rs.faxdetected; end
  1971.   when action = 5 then do; return rs.datadetected; end
  1972.   when action = 8 then do; return rs.busydetected; end
  1973.   when action = 12 then do; return rs.signaldetected; end
  1974.   when action = 14 then do; return rs.error; end
  1975.   when action = 16 then do; return rs.error; end
  1976.   otherwise signal arexxerror
  1977. end
  1978.  
  1979. 'readnkeys' '1' '5'
  1980. action = rc
  1981. if action = 0 then value = result
  1982. select
  1983.   when action = 0 then signal aapresentmenuvalue
  1984.   when action = 4 then do; return rs.faxdetected; end
  1985.   when action = 5 then do; return rs.datadetected; end
  1986.   when action = 8 then do; return rs.busydetected; end
  1987.   when action = 10 then signal aapresentmenutimeout
  1988.   when action = 12 then do; return rs.signaldetected; end
  1989.   when action = 14 then do; return rs.error; end
  1990.   when action = 16 then do; return rs.error; end
  1991.   otherwise signal arexxerror
  1992. end
  1993. return rs.error
  1994.  
  1995. aapresentmenutimeout:
  1996. 'flushphonebuffer'
  1997.  
  1998. 'playvoice' 'avm:voices/TimedOut'
  1999. action = rc
  2000. select
  2001.   when action = 0 then nop
  2002.   when action = 1 then nop
  2003.   when action = 4 then do; return rs.faxdetected; end
  2004.   when action = 5 then do; return rs.datadetected; end
  2005.   when action = 8 then do; return rs.busydetected; end
  2006.   when action = 12 then do; return rs.signaldetected; end
  2007.   when action = 14 then do; return rs.error; end
  2008.   when action = 16 then do; return rs.error; end
  2009.   otherwise signal arexxerror
  2010. end
  2011.  
  2012. timesaround = timesaround - 1; pmTimesAround = timesaround
  2013. if timesaround <= 0 then return rs.timedout
  2014. signal aapresentmenuloop
  2015.  
  2016. aapresentmenuvalue:
  2017. if pos(value, valid) = 0 then signal aainvalid
  2018. return '=' || value
  2019.  
  2020. aainvalid:
  2021. 'flushphonebuffer'
  2022.  
  2023. 'playvoice' 'avm:voices/BadChoice'
  2024. action = rc
  2025. select
  2026.   when action = 0 then nop
  2027.   when action = 1 then nop
  2028.   when action = 4 then do; return rs.faxdetected; end
  2029.   when action = 5 then do; return rs.datadetected; end
  2030.   when action = 8 then do; return rs.busydetected; end
  2031.   when action = 12 then do; return rs.signaldetected; end
  2032.   when action = 14 then do; return rs.error; end
  2033.   when action = 16 then do; return rs.error; end
  2034.   otherwise signal arexxerror
  2035. end
  2036.  
  2037. timesaround = timesaround - 1; pmTimesAround = timesaround
  2038. if timesaround <= 0 then return rs.timedout
  2039. signal aapresentmenuloop
  2040.  
  2041.  
  2042. aaprocessmailbox:
  2043. /* TITLE: avm:rexx/processmailbox.avm */
  2044. /* Function which has one argument, the mailbox */
  2045.  
  2046. procedure expose acidname acidnumber mailbox faxscript datascript
  2047. parse arg mailbox .
  2048. call loadMailBox(mailbox)
  2049. calledSysop = 0
  2050. pagedSysop = 0
  2051.  
  2052. if mailbox.autoalertb = 1 & mailbox.autoalertscript ~= '' then
  2053.   address rexx 'alertsysop' mailbox
  2054.  
  2055. 'playvoice' voiceFile(mailbox,'Personal')
  2056. action = rc
  2057. select
  2058.   when action = 0 then nop
  2059.   when action = 1 then signal aakeypressed
  2060.   when action = 4 then signal stdfax
  2061.   when action = 5 then signal stddata
  2062.   when action = 8 then signal stdbusy
  2063.   when action = 12 then signal stdabort
  2064.   when action = 14 then nop
  2065.   when action = 16 then nop
  2066.   otherwise signal arexxerror
  2067. end
  2068.  
  2069. aaAnnounce:
  2070. if mailbox.autoforwardannounce = 1 & mailbox.autoforward ~= '' then call announceForwardNumber
  2071.  
  2072. aanopersonal:
  2073. 'playvoice' 'avm:voices/MailboxGreeting'
  2074. action = rc
  2075. select
  2076.   when action = 0 then nop
  2077.   when action = 1 then signal aakeypressed
  2078.   when action = 4 then signal stdfax
  2079.   when action = 5 then signal stddata
  2080.   when action = 8 then signal stdbusy
  2081.   when action = 12 then signal stdabort
  2082.   when action = 14 then signal stderror
  2083.   when action = 16 then signal stderror
  2084.   otherwise signal arexxerror
  2085. end
  2086.  
  2087. /* Init log file stuff */
  2088.  
  2089. aaskipinstructions:
  2090. handle = makeUniqueFile()
  2091. call initLogEntry()
  2092. call time('r')
  2093.  
  2094. userBeep = getclip('AVMUserBeep')
  2095. if userBeep = 'YES' then do
  2096.  
  2097. 'playvoice' 'avm:voices/UserBeep'
  2098. action = rc
  2099. select
  2100.   when action = 0 then nop
  2101.   when action = 1 then signal aakeypressed
  2102.   when action = 4 then signal stdfax
  2103.   when action = 5 then signal stddata
  2104.   when action = 8 then signal stdbusy
  2105.   when action = 12 then signal stdabort
  2106.   when action = 14 then signal stderror
  2107.   when action = 16 then signal stderror
  2108.   otherwise signal arexxerror
  2109. end
  2110.  
  2111. end; else do
  2112.  
  2113. 'playbeep' '3000' '0' '4'
  2114. action = rc
  2115. select
  2116.   when action = 0 then nop
  2117.   when action = 1 then nop
  2118.   when action = 4 then signal stdfax
  2119.   when action = 5 then signal stddata
  2120.   when action = 8 then signal stdbusy
  2121.   when action = 12 then signal stdabort
  2122.   when action = 14 then signal stderror
  2123.   when action = 16 then signal stderror
  2124.   otherwise signal arexxerror
  2125. end
  2126.  
  2127. end
  2128.  
  2129. 'recordvoice' '0' '-1' '-1' voiceFile(mailbox,handle)
  2130. action = rc
  2131. select
  2132.   when action = 0 then nop
  2133.   when action = 1 then do; call aafixlog; signal aakeypressedafterrecord; end
  2134.   when action = 2 then do; call aafixlog; signal stdabort; end
  2135.   when action = 3 then do; call aafixlog; if upper(getclip('AVMDataAfterSilence')) = 'YES' then signal stddata; else signal stdabort; end
  2136.   when action = 4 then do; call aafixlog; signal stdfax; end
  2137.   when action = 5 then do; call aafixlog; signal stddata; end
  2138.   when action = 8 then do; call aafixlog; signal stdbusy; end
  2139.   when action = 10 then do; call aafixlog; signal aakeypressedafterrecord; end
  2140.   when action = 12 then do; call aafixlog; signal stdabort; end
  2141.   when action = 14 then do; call aafixlog; signal stderror; end
  2142.   when action = 16 then do; call aafixlog; signal stderror; end
  2143.   otherwise signal arexxerror
  2144. end
  2145.  
  2146. /* Shouldn't get here */
  2147. signal stderror
  2148.  
  2149. aafixlog:
  2150. /* This writes out the log file */
  2151.  
  2152. if mailbox.autoforwardb = 1 & mailbox.autoforwardondemand = "" & calledSysop = 0 then do
  2153.   call aaCallSysop
  2154. end
  2155. if mailbox.autopageb = 1 & mailbox.autopageondemand = "" & pagedSysop = 0 then do
  2156.   call aaPageSysop
  2157. end
  2158.  
  2159. log.filename = handle
  2160. log.length = trunc(time('e'))
  2161. log.type = 'voice'
  2162. call saveLogEntry(mailbox, handle)
  2163. preConv = upper(getclip('AVMPreConvert'))
  2164. if preConv = 'YES' then
  2165.   address command 'run >nil: <nil: avm:adpcm2iff' ,
  2166.   voiceFile(mailbox, handle) voiceFile(mailbox, handle) || 'i' '-nogui -1second'
  2167. return
  2168.  
  2169. aakeypressedafterrecord:
  2170. 'flushphonebuffer'
  2171.  
  2172. processmailboxmenu:
  2173. call aapresentmenu('avm:voices/MailboxCaller', '012345679#*', '3')
  2174. action = result
  2175. select
  2176.   when action = '=0' then signal processmailboxmenu
  2177.   when action = '=1' then signal aaAnnounce
  2178.   when action = '=2' then signal stdfaxinstruct
  2179.   when action = '=3' then do; call aaleavenumber(); end
  2180.   when action = '=4' then do; good = getpassword(mailbox.autoalertondemand); if good then address rexx 'alertsysop' mailbox; end
  2181.   when action = '=5' then signal stddatainstruct
  2182.   when action = '=6' then do; good = getpassword(mailbox.autoforwardondemand); if good & calledSysop = 0 then call aaCallSysop(); end
  2183.   when action = '=7' then do; good = getpassword(mailbox.autopageondemand); if good & pagedSysop = 0 then call aaPageSysop(); end
  2184.   when action = '=8' then nop
  2185.   when action = '=9' then do; call aamaintenancemode(mailbox); end
  2186.   when action = '=#' then do; return; end
  2187.   when action = '=*' then signal answervoiceDone
  2188.   when action = 4 then signal stdfax
  2189.   when action = 5 then signal stddata
  2190.   when action = 8 then signal stdbusy
  2191.   when action = 10 then signal answervoiceDone
  2192.   when action = 12 then signal stdabort
  2193.   when action = 14 then signal stderror
  2194.   when action = 16 then signal stderror
  2195.   otherwise signal arexxerror
  2196. end
  2197. signal processmailboxmenu
  2198.  
  2199. /* Shouldn't get here */
  2200. signal stderror
  2201.  
  2202. aaleavenumber:
  2203. number = getNumber()
  2204.  
  2205. log.returnnumber = number
  2206. call updateLogEntry(mailbox, handle)
  2207. return
  2208.  
  2209. aakeypressed:
  2210. call aapresentmenu('avm:voices/SkipFaxMaintenance', '012359#*', '3')
  2211. action = result
  2212. select
  2213.   when action = '=0' then signal aakeypressed
  2214.   when action = '=1' then signal aaskipinstructions
  2215.   when action = '=2' then signal stdfaxinstruct
  2216.   when action = '=3' then signal aaAnnounce
  2217.   when action = '=4' then nop
  2218.   when action = '=5' then signal stddatainstruct
  2219.   when action = '=6' then nop
  2220.   when action = '=7' then nop
  2221.   when action = '=8' then nop
  2222.   when action = '=9' then do; call aamaintenancemode(mailbox); end
  2223.   when action = '=#' then do; return; end
  2224.   when action = '=*' then signal stdabort
  2225.   when action = 4 then signal stdfax
  2226.   when action = 5 then signal stddata
  2227.   when action = 8 then signal stdbusy
  2228.   when action = 10 then signal answervoiceDone
  2229.   when action = 12 then signal stdabort
  2230.   when action = 14 then signal stderror
  2231.   when action = 16 then signal stderror
  2232.   otherwise signal arexxerror
  2233. end
  2234. return
  2235.  
  2236. /* TITLE: avm:rexx/maintenancemode.avm */
  2237. aamaintenancemode:
  2238. procedure
  2239. parse arg mailbox .
  2240.  
  2241. call loadMailbox(mailbox)
  2242. good = getPassword(mailbox.password)
  2243. if good = 0 then signal answerVoiceDone
  2244.  
  2245. logsthis = words(showdir(logFile(mailbox, '')))
  2246. logsanonymous = words(showdir(logFile('anonymous', '')))
  2247. if upper(mailbox) = 'ANONYMOUS' then logsanonymous = 0
  2248.  
  2249. if logsthis > 0 then call sayCountEntries(logsthis, 0)
  2250. if logsanonymous > 0 then call sayCountEntries(logsanonymous, 1)
  2251.  
  2252. maintenanceModeAgain:
  2253. call aapresentmenu('avm:voices/maintenancemode', '01234567#*', '3')
  2254. action = result
  2255. select
  2256.   when action = '=0' then signal maintenanceModeAgain
  2257.   when action = '=1' then do; call retrievemessages(mailbox); end
  2258.   when action = '=2' then do; call recordMessage(voiceFile(mailbox, 'Personal')); end
  2259.   when action = '=3' then do; call changeintrooptions(); end
  2260.   when action = '=4' then do; call changepassword(); end
  2261.   when action = '=5' then do; call sendMessageTo('Outgoing', mailbox, '', makeUniqueFile(), 'Voice', voiceFile(mailbox, 'Introduction'), '', ''); end
  2262.   when action = '=6' then do; call changeautooptions(mailbox); end
  2263.   when action = '=7' then do; call aaretrievemessages('Outgoing', 1, mailbox); end
  2264.   when action = '=8' then nop
  2265.   when action = '=9' then nop
  2266.   when action = '=#' then do; return; end
  2267.   when action = '=*' then signal answervoiceDone
  2268.   when action = 4 then signal stdfax
  2269.   when action = 5 then signal stddata
  2270.   when action = 8 then signal stdbusy
  2271.   when action = 10 then signal answerVoiceDone
  2272.   when action = 12 then signal stdabort
  2273.   when action = 14 then signal stderror
  2274.   when action = 16 then signal stderror
  2275.   otherwise signal arexxerror
  2276. end
  2277. signal maintenanceModeAgain
  2278.  
  2279. /* TITLE: avm:rexx/getpassword.avm */
  2280. /* This is a procedure which accepts 1 argument, a password */
  2281.  
  2282. getpassword:
  2283. procedure
  2284. parse arg password
  2285. count = 3 /* max of 3 times */
  2286. if password = '' then return 1
  2287.  
  2288. getpasswordagain:
  2289. count = count - 1
  2290. if count = 0 then return 0 /* didn't get a good password */
  2291.  
  2292. 'playvoice' 'avm:voices/getpassword'
  2293. action = rc
  2294. select
  2295.   when action = 0 then nop
  2296.   when action = 1 then nop
  2297.   when action = 4 then signal stdfax
  2298.   when action = 5 then signal stddata
  2299.   when action = 8 then signal stdbusy
  2300.   when action = 12 then signal stdabort
  2301.   when action = 14 then signal stderror
  2302.   when action = 16 then signal stderror
  2303.   otherwise signal arexxerror
  2304. end
  2305.  
  2306. 'readkeysuntil' '#' '10' '7'
  2307. action = rc
  2308. if action = 0 then value = result
  2309. select
  2310.   when action = 0 then signal getpasskeydetected
  2311.   when action = 4 then signal stdfax
  2312.   when action = 5 then signal stddata
  2313.   when action = 8 then signal stdbusy
  2314.   when action = 10 then nop
  2315.   when action = 12 then signal stdabort
  2316.   when action = 14 then signal stderror
  2317.   when action = 16 then signal stderror
  2318.   otherwise signal arexxerror
  2319. end
  2320.  
  2321. 'playvoice' 'avm:voices/passwordtimeout'
  2322. action = rc
  2323. select
  2324.   when action = 0 then nop
  2325.   when action = 1 then nop
  2326.   when action = 4 then signal stdfax
  2327.   when action = 5 then signal stddata
  2328.   when action = 8 then signal stdbusy
  2329.   when action = 12 then signal stdabort
  2330.   when action = 14 then signal stderror
  2331.   when action = 16 then signal stderror
  2332.   otherwise signal arexxerror
  2333. end
  2334. signal getpasswordagain
  2335.  
  2336. getpasskeydetected:
  2337. if value = password then return 1
  2338.  
  2339. 'playvoice' 'avm:voices/passwordbad'
  2340. action = rc
  2341. select
  2342.   when action = 0 then nop
  2343.   when action = 1 then nop
  2344.   when action = 4 then signal stdfax
  2345.   when action = 5 then signal stddata
  2346.   when action = 8 then signal stdbusy
  2347.   when action = 12 then signal stdabort
  2348.   when action = 14 then signal stderror
  2349.   when action = 16 then signal stderror
  2350.   otherwise signal arexxerror
  2351. end
  2352. signal getpasswordagain
  2353.  
  2354.  
  2355. retrievemessages:
  2356. procedure
  2357. parse arg mailbox .
  2358. call aaretrievemessages(mailbox, 0, mailbox)
  2359.  
  2360. if upper(mailbox) = 'ANONYMOUS' then return
  2361.  
  2362. 'playvoice' 'avm:voices/retrieveanonymous'
  2363. action = rc
  2364. select
  2365.   when action = 0 then nop
  2366.   when action = 1 then nop
  2367.   when action = 4 then signal stdfax
  2368.   when action = 5 then signal stddata
  2369.   when action = 8 then signal stdbusy
  2370.   when action = 12 then signal stdabort
  2371.   when action = 14 then signal stderror
  2372.   when action = 16 then signal stderror
  2373.   otherwise signal arexxerror
  2374. end
  2375.  
  2376. call aaretrievemessages('Anonymous', 0, mailbox)
  2377.  
  2378. 'playvoice' 'avm:voices/backhome'
  2379. action = rc
  2380. select
  2381.   when action = 0 then nop
  2382.   when action = 1 then nop
  2383.   when action = 4 then signal stdfax
  2384.   when action = 5 then signal stddata
  2385.   when action = 8 then signal stdbusy
  2386.   when action = 12 then signal stdabort
  2387.   when action = 14 then signal stderror
  2388.   when action = 16 then signal stderror
  2389.   otherwise signal arexxerror
  2390. end
  2391. return
  2392.  
  2393. changepassword:
  2394. number = getNumber()
  2395. if number ~= '' then do
  2396.   mailbox.password = number
  2397.   call saveMailbox(mailbox)
  2398. end
  2399. return
  2400.  
  2401. sayCountEntries:
  2402. parse arg count, inAnon
  2403. if count = 1 & inAnon then signal say1Anon
  2404. else if count = 1 & inAnon = 0 then signal say1This
  2405.  
  2406. sayCountMultiple:
  2407. 'playvoice' 'avm:voices/ThereAre'
  2408. action = rc
  2409. select
  2410.   when action = 0 then nop
  2411.   when action = 1 then nop
  2412.   when action = 4 then signal stdfax
  2413.   when action = 5 then signal stddata
  2414.   when action = 8 then signal stdbusy
  2415.   when action = 12 then signal stdabort
  2416.   when action = 14 then signal stderror
  2417.   when action = 16 then signal stderror
  2418.   otherwise signal arexxerror
  2419. end
  2420.  
  2421. call playddnumber(count)
  2422. if inAnon then signal sayCountAnon
  2423. else signal sayCountThis
  2424.  
  2425. sayCountAnon:
  2426. 'playvoice' 'avm:voices/InAnonMailbox'
  2427. action = rc
  2428. select
  2429.   when action = 0 then nop
  2430.   when action = 1 then nop
  2431.   when action = 4 then signal stdfax
  2432.   when action = 5 then signal stddata
  2433.   when action = 8 then signal stdbusy
  2434.   when action = 12 then signal stdabort
  2435.   when action = 14 then signal stderror
  2436.   when action = 16 then signal stderror
  2437.   otherwise signal arexxerror
  2438. end
  2439. return
  2440.  
  2441. sayCountThis:
  2442. 'playvoice' 'avm:voices/InThisMailbox'
  2443. action = rc
  2444. select
  2445.   when action = 0 then nop
  2446.   when action = 1 then nop
  2447.   when action = 4 then signal stdfax
  2448.   when action = 5 then signal stddata
  2449.   when action = 8 then signal stdbusy
  2450.   when action = 12 then signal stdabort
  2451.   when action = 14 then signal stderror
  2452.   when action = 16 then signal stderror
  2453.   otherwise signal arexxerror
  2454. end
  2455. return
  2456.  
  2457. say1Anon:
  2458. 'playvoice' 'avm:voices/OneInAnonMailbox'
  2459. action = rc
  2460. select
  2461.   when action = 0 then nop
  2462.   when action = 1 then nop
  2463.   when action = 4 then signal stdfax
  2464.   when action = 5 then signal stddata
  2465.   when action = 8 then signal stdbusy
  2466.   when action = 12 then signal stdabort
  2467.   when action = 14 then signal stderror
  2468.   when action = 16 then signal stderror
  2469.   otherwise signal arexxerror
  2470. end
  2471. return
  2472.  
  2473. say1This:
  2474. 'playvoice' 'avm:voices/OneInThisMailbox'
  2475. action = rc
  2476. select
  2477.   when action = 0 then nop
  2478.   when action = 1 then nop
  2479.   when action = 4 then signal stdfax
  2480.   when action = 5 then signal stddata
  2481.   when action = 8 then signal stdbusy
  2482.   when action = 12 then signal stdabort
  2483.   when action = 14 then signal stderror
  2484.   when action = 16 then signal stderror
  2485.   otherwise signal arexxerror
  2486. end
  2487. return
  2488.  
  2489. changeintrooptions:
  2490. call aapresentmenu('avm:voices/changeintrooptions', '012345#*', '3')
  2491. action = result
  2492. select
  2493.   when action = '=0' then signal changeintrooptions
  2494.   when action = '=1' then do; call setclip('AVMIntroductionType', 'DAYOFWEEK'); end
  2495.   when action = '=2' then do; call setclip('AVMIntroductionType', 'TIMEOFDAY'); end
  2496.   when action = '=3' then do; call setclip('AVMIntroductionType', 'RANDOM'); end
  2497.   when action = '=4' then do; call changetomanual(); end
  2498.   when action = '=5' then do; call recordintro(); end
  2499.   when action = '=6' then nop
  2500.   when action = '=7' then nop
  2501.   when action = '=8' then nop
  2502.   when action = '=9' then nop
  2503.   when action = '=#' then do; return; end
  2504.   when action = '=*' then signal answervoiceDone
  2505.   when action = 4 then signal stdfax
  2506.   when action = 5 then signal stddata
  2507.   when action = 8 then signal stdbusy
  2508.   when action = 10 then signal answerVoiceDone
  2509.   when action = 12 then signal stdabort
  2510.   when action = 14 then signal stderror
  2511.   when action = 16 then signal stderror
  2512.   otherwise signal arexxerror
  2513. end
  2514. signal changeintrooptions
  2515.  
  2516. changetomanual:
  2517. call aapresentmenu('avm:voices/selectmanualintro', '01234567#*', '3')
  2518. action = result
  2519. select
  2520.   when action = '=0' then signal changetomanual
  2521.   when action = '=1' then do; call setclip('AVMIntroductionType', '1'); end
  2522.   when action = '=2' then do; call setclip('AVMIntroductionType', '2'); end
  2523.   when action = '=3' then do; call setclip('AVMIntroductionType', '3'); end
  2524.   when action = '=4' then do; call setclip('AVMIntroductionType', '4'); end
  2525.   when action = '=5' then do; call setclip('AVMIntroductionType', '5'); end
  2526.   when action = '=6' then do; call setclip('AVMIntroductionType', '6'); end
  2527.   when action = '=7' then do; call setclip('AVMIntroductionType', '7'); end
  2528.   when action = '=8' then nop
  2529.   when action = '=9' then nop
  2530.   when action = '=#' then do; return; end
  2531.   when action = '=*' then signal answervoiceDone
  2532.   when action = 4 then signal stdfax
  2533.   when action = 5 then signal stddata
  2534.   when action = 8 then signal stdbusy
  2535.   when action = 10 then signal answerVoiceDone
  2536.   when action = 12 then signal stdabort
  2537.   when action = 14 then signal stderror
  2538.   when action = 16 then signal stderror
  2539.   otherwise signal arexxerror
  2540. end
  2541. signal changetomanual
  2542.  
  2543. recordintro:
  2544. call aapresentmenu('avm:voices/recordintro', '01234567#*', '3')
  2545. action = result
  2546. select
  2547.   when action = '=0' then signal recordintro
  2548.   when action = '=1' then do; call recordmessage('avm:voices/intro1'); end
  2549.   when action = '=2' then do; call recordmessage('avm:voices/intro2'); end
  2550.   when action = '=3' then do; call recordmessage('avm:voices/intro3'); end
  2551.   when action = '=4' then do; call recordmessage('avm:voices/intro4'); end
  2552.   when action = '=5' then do; call recordmessage('avm:voices/intro5'); end
  2553.   when action = '=6' then do; call recordmessage('avm:voices/intro6'); end
  2554.   when action = '=7' then do; call recordmessage('avm:voices/intro7'); end
  2555.   when action = '=8' then nop
  2556.   when action = '=9' then nop
  2557.   when action = '=#' then do; return; end
  2558.   when action = '=*' then signal answervoiceDone
  2559.   when action = 4 then signal stdfax
  2560.   when action = 5 then signal stddata
  2561.   when action = 8 then signal stdbusy
  2562.   when action = 10 then signal answerVoiceDone
  2563.   when action = 12 then signal stdabort
  2564.   when action = 14 then signal stderror
  2565.   when action = 16 then signal stderror
  2566.   otherwise signal arexxerror
  2567. end
  2568. signal recordintro
  2569.  
  2570. changeautooptions:
  2571. procedure
  2572. parse arg mailbox .
  2573. call loadMailbox(mailbox)
  2574.  
  2575. changeautomenu:
  2576. call aapresentmenu('avm:voices/ChangeAutoOptions', '0123#*', '3')
  2577. action = result
  2578. select
  2579.   when action = '=0' then signal changeautomenu
  2580.   when action = '=1' then do; call editautooptions('AUTOFORWARDB', 'AUTOFORWARDONDEMAND', 'AUTOFORWARD', 'AUTOFORWARDANNOUNCE'); end
  2581.   when action = '=2' then do; call editautooptions('AUTOFAXFORWARDB', '', 'AUTOFAXFORWARD', ''); end
  2582.   when action = '=3' then do; call editautooptions('AUTOPAGEB', 'AUTOPAGEONDEMAND', 'AUTOPAGE', ''); end
  2583.   when action = '=4' then nop
  2584.   when action = '=5' then nop
  2585.   when action = '=6' then nop
  2586.   when action = '=7' then nop
  2587.   when action = '=8' then nop
  2588.   when action = '=9' then nop
  2589.   when action = '=#' then do; return; end
  2590.   when action = '=*' then signal answerVoiceDone
  2591.   when action = 4 then signal stdfax
  2592.   when action = 5 then signal stddata
  2593.   when action = 8 then signal stdbusy
  2594.   when action = 10 then signal answerVoiceDone
  2595.   when action = 12 then signal stdabort
  2596.   when action = 14 then signal stderror
  2597.   when action = 16 then signal stderror
  2598.   otherwise signal arexxerror
  2599. end
  2600. signal changeautomenu
  2601.  
  2602. editautooptions:
  2603. procedure expose mailbox. mailbox
  2604. parse arg isOn, onDemand, telNumber, announce
  2605. call showAutoOptions
  2606.  
  2607. editautomenu:
  2608. call aapresentmenu('avm:voices/AutoOptions', '01234567#*', '3')
  2609. action = result
  2610. select
  2611.   when action = '=0' then signal editautomenu
  2612.   when action = '=1' then do; mailbox.isOn = 1; call saveMailbox(mailbox); end
  2613.   when action = '=2' then do; mailbox.isOn = 0; call saveMailbox(mailbox); end
  2614.   when action = '=3' then do; mailbox.telNumber = getNumber(); call saveMailbox(mailbox); end
  2615.   when action = '=4' then do; if onDemand ~= '' then do; mailbox.onDemand = getNumber(); call saveMailbox(mailbox); end; end
  2616.   when action = '=5' then do; if announce ~= '' then do; mailbox.announce = 1; call saveMailbox(mailbox); end; end
  2617.   when action = '=6' then do; if announce ~= '' then do; mailbox.announce = 0; call saveMailbox(mailbox); end; end
  2618.   when action = '=7' then do; call showAutoOptions(); end
  2619.   when action = '=8' then nop
  2620.   when action = '=9' then nop
  2621.   when action = '=#' then do; return; end
  2622.   when action = '=*' then signal answerVoiceDone
  2623.   when action = 4 then signal stdfax
  2624.   when action = 5 then signal stddata
  2625.   when action = 8 then signal stdbusy
  2626.   when action = 10 then signal answerVoiceDone
  2627.   when action = 12 then signal stdabort
  2628.   when action = 14 then signal stderror
  2629.   when action = 16 then signal stderror
  2630.   otherwise signal arexxerror
  2631. end
  2632. signal editautomenu
  2633.  
  2634. showautooptions:
  2635. if mailbox.isOn = 1 then call autoIsOn(); else call autoIsOff()
  2636. if onDemand ~= '' then call autoOnDemand(mailbox.onDemand)
  2637. call autoTelNumber(mailbox.telNumber)
  2638. if announce ~= '' then
  2639.   if mailbox.announce = 1 then call announceIsOn(); else call announceIsOff()
  2640. return
  2641.  
  2642. autoIsOn:
  2643. 'playvoice' 'avm:voices/AutoIsOn'
  2644. action = rc
  2645. select
  2646.   when action = 0 then nop
  2647.   when action = 1 then nop
  2648.   when action = 4 then signal stdfax
  2649.   when action = 5 then signal stddata
  2650.   when action = 8 then signal stdbusy
  2651.   when action = 12 then signal stdabort
  2652.   when action = 14 then signal stderror
  2653.   when action = 16 then signal stderror
  2654.   otherwise signal arexxerror
  2655. end
  2656.  
  2657. 'flushphonebuffer'
  2658. return
  2659.  
  2660. autoIsOff:
  2661. 'playvoice' 'avm:voices/autoIsOff'
  2662. action = rc
  2663. select
  2664.   when action = 0 then nop
  2665.   when action = 1 then nop
  2666.   when action = 4 then signal stdfax
  2667.   when action = 5 then signal stddata
  2668.   when action = 8 then signal stdbusy
  2669.   when action = 12 then signal stdabort
  2670.   when action = 14 then signal stderror
  2671.   when action = 16 then signal stderror
  2672.   otherwise signal arexxerror
  2673. end
  2674.  
  2675. 'flushphonebuffer'
  2676. return
  2677.  
  2678. announceIsOn:
  2679. 'playvoice' 'avm:voices/AnnounceIsOn'
  2680. action = rc
  2681. select
  2682.   when action = 0 then nop
  2683.   when action = 1 then nop
  2684.   when action = 4 then signal stdfax
  2685.   when action = 5 then signal stddata
  2686.   when action = 8 then signal stdbusy
  2687.   when action = 12 then signal stdabort
  2688.   when action = 14 then signal stderror
  2689.   when action = 16 then signal stderror
  2690.   otherwise signal arexxerror
  2691. end
  2692.  
  2693. 'flushphonebuffer'
  2694. return
  2695.  
  2696. announceIsOff:
  2697. 'playvoice' 'avm:voices/AnnounceIsOff'
  2698. action = rc
  2699. select
  2700.   when action = 0 then nop
  2701.   when action = 1 then nop
  2702.   when action = 4 then signal stdfax
  2703.   when action = 5 then signal stddata
  2704.   when action = 8 then signal stdbusy
  2705.   when action = 12 then signal stdabort
  2706.   when action = 14 then signal stderror
  2707.   when action = 16 then signal stderror
  2708.   otherwise signal arexxerror
  2709. end
  2710.  
  2711. 'flushphonebuffer'
  2712. return
  2713.  
  2714. autoOnDemand:
  2715. procedure
  2716. parse arg number
  2717.  
  2718. 'playvoice' 'avm:voices/AutoOnDemand'
  2719. action = rc
  2720. select
  2721.   when action = 0 then nop
  2722.   when action = 1 then nop
  2723.   when action = 4 then signal stdfax
  2724.   when action = 5 then signal stddata
  2725.   when action = 8 then signal stdbusy
  2726.   when action = 12 then signal stdabort
  2727.   when action = 14 then signal stderror
  2728.   when action = 16 then signal stderror
  2729.   otherwise signal arexxerror
  2730. end
  2731.  
  2732. call playNumber(number)
  2733.  
  2734. 'flushphonebuffer'
  2735. return
  2736.  
  2737. autoTelNumber:
  2738. procedure
  2739. parse arg number
  2740.  
  2741. 'playvoice' 'avm:voices/AutoTelNumber'
  2742. action = rc
  2743. select
  2744.   when action = 0 then nop
  2745.   when action = 1 then nop
  2746.   when action = 4 then signal stdfax
  2747.   when action = 5 then signal stddata
  2748.   when action = 8 then signal stdbusy
  2749.   when action = 12 then signal stdabort
  2750.   when action = 14 then signal stderror
  2751.   when action = 16 then signal stderror
  2752.   otherwise signal arexxerror
  2753. end
  2754.  
  2755. call playNumber(number)
  2756.  
  2757. 'flushphonebuffer'
  2758. return
  2759.  
  2760. /* TITLE: avm:rexx/retrievemessages.avm */
  2761. aaretrievemessages:
  2762. procedure
  2763. parse arg mailbox, isOutgoing, whichMailbox
  2764.  
  2765. logs = showdir(logFile(mailbox, ''))
  2766. numlogs = words(logs)
  2767. currentlog = 1
  2768.  
  2769. retrievemessagesnext:
  2770. if currentlog > numlogs then signal retrievemessagesdone
  2771. currentHandle = word(logs, currentLog)
  2772. call loadLogEntry(mailbox, currentHandle)
  2773. if (isOutgoing & ( log.returnRetry = '' | log.returnRetry = 0 | (upper(log.origMailbox) ~= upper(whichMailbox) & upper(log.origMailbox) ~= 'ANONYMOUS'))) then do
  2774.   currentLog = currentLog + 1
  2775.   signal retrieveMessagesNext
  2776. end
  2777.  
  2778. retrievemessagesagain:
  2779. logtype = upper(log.type)
  2780. if logtype = 'FAX' then signal isfax
  2781. else if logtype = 'VOICE' then signal isvoice
  2782. else signal isunknown
  2783.  
  2784. isfax:
  2785. 'playvoice' 'avm:voices/FaxMessage'
  2786. action = rc
  2787. select
  2788.   when action = 0 then nop
  2789.   when action = 1 then nop
  2790.   when action = 4 then signal stdfax
  2791.   when action = 5 then signal stddata
  2792.   when action = 8 then signal stdbusy
  2793.   when action = 12 then signal stdabort
  2794.   when action = 14 then signal stderror
  2795.   when action = 16 then signal stderror
  2796.   otherwise signal arexxerror
  2797. end
  2798. signal aftertype
  2799.  
  2800. isvoice:
  2801. 'playbeep' '3000' '0' '4'
  2802. action = rc
  2803. select
  2804.   when action = 0 then nop
  2805.   when action = 1 then nop
  2806.   when action = 4 then nop
  2807.   when action = 5 then nop
  2808.   when action = 8 then nop
  2809.   when action = 12 then signal stdabort
  2810.   when action = 14 then signal stderror
  2811.   when action = 16 then signal stderror
  2812.   otherwise signal arexxerror
  2813. end
  2814.  
  2815. 'playvoice' voiceFile(mailbox, log.filename)
  2816. action = rc
  2817. select
  2818.   when action = 0 then nop
  2819.   when action = 1 then nop
  2820.   when action = 4 then nop
  2821.   when action = 5 then nop
  2822.   when action = 8 then nop
  2823.   when action = 12 then signal stdabort
  2824.   when action = 14 then nop
  2825.   when action = 16 then nop
  2826.   otherwise signal arexxerror
  2827. end
  2828.  
  2829. 'flushphonebuffer'
  2830.  
  2831. 'playbeep' '3000' '0' '4'
  2832. action = rc
  2833. select
  2834.   when action = 0 then nop
  2835.   when action = 1 then nop
  2836.   when action = 4 then nop
  2837.   when action = 5 then nop
  2838.   when action = 8 then nop
  2839.   when action = 12 then signal stdabort
  2840.   when action = 14 then signal stderror
  2841.   when action = 16 then signal stderror
  2842.   otherwise signal arexxerror
  2843. end
  2844. signal aftertype
  2845.  
  2846. isunknown:
  2847. 'playvoice' 'avm:voices/UnknownMessage'
  2848. action = rc
  2849. select
  2850.   when action = 0 then nop
  2851.   when action = 1 then nop
  2852.   when action = 4 then signal stdfax
  2853.   when action = 5 then signal stddata
  2854.   when action = 8 then signal stdbusy
  2855.   when action = 12 then signal stdabort
  2856.   when action = 14 then signal stderror
  2857.   when action = 16 then signal stderror
  2858.   otherwise signal arexxerror
  2859. end
  2860. signal aftertype
  2861.  
  2862. aftertype:
  2863. call aapresentmenu('avm:voices/RetrieveMessages', '012345678#*', '3')
  2864. action = result
  2865. select
  2866.   when action = '=0' then signal aftertype
  2867.   when action = '=1' then signal retrievemessagesagain
  2868.   when action = '=2' then do; call playtimedate(); end
  2869.   when action = '=3' then do; call playtelcidnumber(); end
  2870.   when action = '=4' then signal processNextMessage
  2871.   when action = '=5' then do; address rexx 'delete' mailbox currentHandle; signal processNextMessage; end
  2872.   when action = '=6' then do; if isOutgoing = 0 then address rexx 'archive' mailbox currentHandle; else address rexx 'archiveoutgoing' mailbox currentHandle; signal processNextMessage; end
  2873.   when action = '=7' then do; call forwardmessage(mailbox, currentHandle); end
  2874.   when action = '=8' then do; call replymessage(mailbox, currentHandle); end
  2875.   when action = '=9' then nop
  2876.   when action = '=#' then do; return; end
  2877.   when action = '=*' then signal answervoiceDone
  2878.   when action = 4 then signal stdfax
  2879.   when action = 5 then signal stddata
  2880.   when action = 8 then signal stdbusy
  2881.   when action = 10 then signal answerVoiceDone
  2882.   when action = 12 then signal stdabort
  2883.   when action = 14 then signal stderror
  2884.   when action = 16 then signal stderror
  2885.   otherwise signal arexxerror
  2886. end
  2887. signal aftertype
  2888.  
  2889. processNextMessage:
  2890. currentLog = currentLog + 1
  2891. signal retrievemessagesnext
  2892.  
  2893. playtimedate:
  2894. actualTime = convertToTime(log.time)
  2895. actualDate = convertToDate(log.time)
  2896. call playTime(actualTime)
  2897. actualDate = date('s', actualDate) /* convert to sorted */
  2898. call playDate(actualDate)
  2899.  
  2900. 'flushphonebuffer'
  2901.  
  2902. return
  2903.  
  2904. playtelcidnumber:
  2905. 'playvoice' 'avm:voices/cidnumber'
  2906. action = rc
  2907. select
  2908.   when action = 0 then nop
  2909.   when action = 1 then nop
  2910.   when action = 4 then signal stdfax
  2911.   when action = 5 then signal stddata
  2912.   when action = 8 then signal stdbusy
  2913.   when action = 12 then signal stdabort
  2914.   when action = 14 then signal stderror
  2915.   when action = 16 then signal stderror
  2916.   otherwise signal arexxerror
  2917. end
  2918.  
  2919. if symbol('log.cidnumber') = 'VAR' then
  2920.   call playNumber(log.cidnumber)
  2921.  
  2922. 'flushphonebuffer'
  2923.  
  2924. 'playvoice' 'avm:voices/returnnumber'
  2925. action = rc
  2926. select
  2927.   when action = 0 then nop
  2928.   when action = 1 then nop
  2929.   when action = 4 then signal stdfax
  2930.   when action = 5 then signal stddata
  2931.   when action = 8 then signal stdbusy
  2932.   when action = 12 then signal stdabort
  2933.   when action = 14 then signal stderror
  2934.   when action = 16 then signal stderror
  2935.   otherwise signal arexxerror
  2936. end
  2937.  
  2938. if symbol('log.returnnumber') = 'VAR' then
  2939.   call playNumber(log.returnnumber)
  2940.  
  2941. 'flushphonebuffer'
  2942. return
  2943.  
  2944. retrievemessagesdone:
  2945. 'playvoice' 'avm:voices/NoMoreMessages'
  2946. action = rc
  2947. select
  2948.   when action = 0 then nop
  2949.   when action = 1 then nop
  2950.   when action = 4 then signal stdfax
  2951.   when action = 5 then signal stddata
  2952.   when action = 8 then signal stdbusy
  2953.   when action = 12 then signal stdabort
  2954.   when action = 14 then signal stderror
  2955.   when action = 16 then signal stderror
  2956.   otherwise signal arexxerror
  2957. end
  2958. return
  2959.  
  2960. replyMessage:
  2961. procedure
  2962. parse arg mailbox, magicCookie
  2963. call loadLogEntry(mailbox, magicCookie)
  2964. number = log.returnNumber
  2965. if number = '' then number = log.cidNumber
  2966. handle = makeUniqueFile()
  2967. sent = sendMessageTo('Outgoing', mailbox, number, handle, 'Voice', voiceFile(mailbox, 'Introduction'), log.cidNumber, log.cidName)
  2968.  
  2969. return
  2970.  
  2971. forwardMessage:
  2972. procedure
  2973. parse arg mailbox, magicCookie
  2974. call loadLogEntry(mailbox, magicCookie)
  2975.  
  2976. if verify(log.fileName, '/:', 'M') = 0 then
  2977.   address command 'copy >nil: <nil:' voiceFile(mailbox, log.fileName) || '#?' voiceFile('Outgoing', '')
  2978. sent = sendMessageTo('Outgoing', mailbox, '', log.fileName, log.type, voiceFile(mailbox, 'Introduction'), log.cidName, log.cidNumber)
  2979. return
  2980.  
  2981. /* TITLE: avm:rexx/sendmessageto.avm */
  2982. sendMessageTo:
  2983. procedure
  2984. parse arg mailbox, originMailbox, number, actualFilename, fileType, introFileName, acidName, acidNumber
  2985. handle = makeUniqueFile()
  2986. call initLogEntry()
  2987. log.returnNumber = number
  2988. log.filename = actualFilename
  2989. log.type = fileType; log.returnSendFunc = 'DefaultSender'
  2990. log.returnRetry = 3; log.returnInterval = 5
  2991. log.origMailbox = originMailbox
  2992. log.altFileName = introFileName; log.cidName = acidName; log.cidNumber = acidNumber
  2993.  
  2994. if upper(log.type) = 'VOICE' & ~exists(voiceFile(mailbox, log.fileName)) then call smNeedToRecordOut
  2995. if ~exists(voiceFile(mailbox, log.altFileName)) then call smNeedToRecordIntro
  2996. if log.returnNumber = '' then do; call smNeedToEnterTel(); signal sendMessageToMenu; end
  2997.  
  2998. 'playvoice' 'avm:voices/numberToSendTo'
  2999. action = rc
  3000. select
  3001.   when action = 0 then nop
  3002.   when action = 1 then nop
  3003.   when action = 4 then do; call cleanSendMessageTo(); signal stdfax; end
  3004.   when action = 5 then do; call cleanSendMessageTo(); signal stddata; end
  3005.   when action = 8 then do; call cleanSendMessageTo(); signal stdbusy; end
  3006.   when action = 12 then do; call cleanSendMessageTo(); signal stdabort; end
  3007.   when action = 14 then do; call cleanSendMessageTo(); signal stderror; end
  3008.   when action = 16 then do; call cleanSendMessageTo(); signal stderror; end
  3009.   otherwise signal arexxerror
  3010. end
  3011.  
  3012. call playNumber(log.returnNumber)
  3013.  
  3014. 'flushphonebuffer'
  3015.  
  3016. sendMessageToMenu:
  3017. call aapresentmenu('avm:voices/editSendMessage', '01234#*', '3')
  3018. action = result
  3019. select
  3020.   when action = '=0' then signal sendMessageToMenu
  3021.   when action = '=1' then do; call playNumber(log.returnNumber); log.returnNumber = getNumber(); signal sendMessageToMenu; end
  3022.   when action = '=2' then do; if upper(log.type) = 'VOICE' then call recordMessage(voiceFile(mailbox, log.filename)); signal sendMessageToMenu; end
  3023.   when action = '=3' then do; call editIntro(); signal sendMessageToMenu; end
  3024.   when action = '=4' then do; if smCanSend() then do; call saveLogEntry(mailbox, handle); return 1; end; else signal sendMessageToMenu; end
  3025.   when action = '=5' then nop
  3026.   when action = '=6' then nop
  3027.   when action = '=7' then nop
  3028.   when action = '=8' then nop
  3029.   when action = '=9' then nop
  3030.   when action = '=#' then do; call cleanSendMessageTo(); return 0; end
  3031.   when action = '=*' then do; call cleanSendMessageTo(); signal answerVoiceDone; end
  3032.   when action = 4 then do; call cleanSendMessageTo(); signal stdfax; end
  3033.   when action = 5 then do; call cleanSendMessageTo(); signal stddata; end
  3034.   when action = 8 then do; call cleanSendMessageTo(); signal stdbusy; end
  3035.   when action = 10 then do; call cleanSendMessageTo(); signal answerVoiceDone; end
  3036.   when action = 12 then do; call cleanSendMessageTo(); signal stdabort; end
  3037.   when action = 14 then do; call cleanSendMessageTo(); signal stderror; end
  3038.   when action = 16 then do; call cleanSendMessageTo(); signal stderror; end
  3039.   otherwise signal arexxerror
  3040. end
  3041. call cleanSendMessageTo(); return 0
  3042.  
  3043. cleanSendMessageTo:
  3044. if verify(log.fileName, '/:', 'M') = 0 then
  3045.   address command 'delete >nil: <nil: quiet' voiceFile('Outgoing', log.fileName) || '#?'
  3046. if verify(log.altFileName, '/:', 'M') = 0 then
  3047.   address command 'delete >nil: <nil: quiet' voiceFile('Outgoing', log.altFileName) || '#?'
  3048. return
  3049.  
  3050. smNeedToRecordOut:
  3051. 'playvoice' 'avm:voices/NeedToRecordOutgoing'
  3052. action = rc
  3053. select
  3054.   when action = 0 then nop
  3055.   when action = 1 then nop
  3056.   when action = 4 then do; call cleanSendMessageTo(); signal stdfax; end
  3057.   when action = 5 then do; call cleanSendMessageTo(); signal stddata; end
  3058.   when action = 8 then do; call cleanSendMessageTo(); signal stdbusy; end
  3059.   when action = 12 then do; call cleanSendMessageTo(); signal stdabort; end
  3060.   when action = 14 then do; call cleanSendMessageTo(); signal stderror; end
  3061.   when action = 16 then do; call cleanSendMessageTo(); signal stderror; end
  3062.   otherwise signal arexxerror
  3063. end
  3064.  
  3065. 'flushphonebuffer'
  3066. return
  3067.  
  3068. smNeedToRecordIntro:
  3069. 'playvoice' 'avm:voices/NeedToRecordIntro'
  3070. action = rc
  3071. select
  3072.   when action = 0 then nop
  3073.   when action = 1 then nop
  3074.   when action = 4 then do; call cleanSendMessageTo(); signal stdfax; end
  3075.   when action = 5 then do; call cleanSendMessageTo(); signal stddata; end
  3076.   when action = 8 then do; call cleanSendMessageTo(); signal stdbusy; end
  3077.   when action = 12 then do; call cleanSendMessageTo(); signal stdabort; end
  3078.   when action = 14 then do; call cleanSendMessageTo(); signal stderror; end
  3079.   when action = 16 then do; call cleanSendMessageTo(); signal stderror; end
  3080.   otherwise signal arexxerror
  3081. end
  3082.  
  3083. 'flushphonebuffer'
  3084. return
  3085.  
  3086. smNeedToEnterTel:
  3087. 'playvoice' 'avm:voices/NeedToEnterTel'
  3088. action = rc
  3089. select
  3090.   when action = 0 then nop
  3091.   when action = 1 then nop
  3092.   when action = 4 then do; call cleanSendMessageTo(); signal stdfax; end
  3093.   when action = 5 then do; call cleanSendMessageTo(); signal stddata; end
  3094.   when action = 8 then do; call cleanSendMessageTo(); signal stdbusy; end
  3095.   when action = 12 then do; call cleanSendMessageTo(); signal stdabort; end
  3096.   when action = 14 then do; call cleanSendMessageTo(); signal stderror; end
  3097.   when action = 16 then do; call cleanSendMessageTo(); signal stderror; end
  3098.   otherwise signal arexxerror
  3099. end
  3100.  
  3101. 'flushphonebuffer'
  3102. return
  3103.  
  3104. editIntro:
  3105. call aapresentmenu('avm:voices/EditIntro', '0123#*', '3')
  3106. action = result
  3107. select
  3108.   when action = '=0' then signal editIntro
  3109.   when action = '=1' then do; log.altFileName = voiceFile(log.origMailbox, 'Introduction'); end
  3110.   when action = '=2' then do; log.altFileName = makeUniqueFile(); end
  3111.   when action = '=3' then do; call recordMessage(voiceFile(mailbox, log.altFileName)); end
  3112.   when action = '=4' then nop
  3113.   when action = '=5' then nop
  3114.   when action = '=6' then nop
  3115.   when action = '=7' then nop
  3116.   when action = '=8' then nop
  3117.   when action = '=9' then nop
  3118.   when action = '=#' then do; return; end
  3119.   when action = '=*' then do; call cleanSendMessageTo(); signal answerVoiceDone; end
  3120.   when action = 4 then do; call cleanSendMessageTo(); signal stdfax; end
  3121.   when action = 5 then do; call cleanSendMessageTo(); signal stddata; end
  3122.   when action = 8 then do; call cleanSendMessageTo(); signal stdbusy; end
  3123.   when action = 10 then do; call cleanSendMessageTo(); signal answerVoiceDone; end
  3124.   when action = 12 then do; call cleanSendMessageTo(); signal stdabort; end
  3125.   when action = 14 then do; call cleanSendMessageTo(); signal stderror; end
  3126.   when action = 16 then do; call cleanSendMessageTo(); signal stderror; end
  3127.   otherwise signal arexxerror
  3128. end
  3129. signal editIntro
  3130.  
  3131. smCanSend:
  3132. if log.returnNumber = '' then do; call smNeedToEnterTel(); return 0; end
  3133. if upper(log.type) = 'VOICE' & ~exists(voiceFile(mailbox, log.fileName)) then do; call smNeedToRecordOut(); return 0; end
  3134. return 1
  3135.  
  3136.  
  3137.  
  3138. return
  3139.  
  3140. aaCallSysop:
  3141. procedure expose mailbox. mailbox calledSysop
  3142. if mailbox.autoforwardscript ~= "" & mailbox.autoforward ~= "" then do
  3143.      calledSysop = 1
  3144.      handle = makeUniqueFile()
  3145.      call initLogEntry(); log.origmailbox = mailbox
  3146.      log.filename = 'avm:voices/autoforward'; log.type = 'voice'
  3147.      log.returnsendfunc = mailbox.autoforwardscript; log.returninterval = 5
  3148.      log.returnretry = 3; log.returnnumber = mailbox.autoforward; log.altFileName = voiceFile(mailbox, 'Introduction')
  3149.      call saveLogEntry('Outgoing', handle)
  3150.  
  3151. 'playvoice' 'avm:voices/BeingForwarded'
  3152. action = rc
  3153. select
  3154.   when action = 0 then nop
  3155.   when action = 1 then nop
  3156.   when action = 4 then signal stdfax
  3157.   when action = 5 then signal stddata
  3158.   when action = 8 then signal stdbusy
  3159.   when action = 12 then signal stdabort
  3160.   when action = 14 then signal stderror
  3161.   when action = 16 then signal stderror
  3162.   otherwise signal arexxerror
  3163. end
  3164.  
  3165.     call playNumber(mailbox.autoforward)
  3166.  
  3167. 'flushphonebuffer'
  3168.  
  3169. end
  3170. return
  3171.  
  3172. announceForwardNumber:
  3173. 'playvoice' 'avm:voices/AnnounceForward'
  3174. action = rc
  3175. select
  3176.   when action = 0 then nop
  3177.   when action = 1 then nop
  3178.   when action = 4 then signal stdfax
  3179.   when action = 5 then signal stddata
  3180.   when action = 8 then signal stdbusy
  3181.   when action = 12 then signal stdabort
  3182.   when action = 14 then signal stderror
  3183.   when action = 16 then signal stderror
  3184.   otherwise signal arexxerror
  3185. end
  3186.  
  3187. call playNumber(mailbox.autoforward)
  3188.  
  3189. 'playvoice' 'avm:voices/AnnounceAgain'
  3190. action = rc
  3191. select
  3192.   when action = 0 then nop
  3193.   when action = 1 then nop
  3194.   when action = 4 then signal stdfax
  3195.   when action = 5 then signal stddata
  3196.   when action = 8 then signal stdbusy
  3197.   when action = 12 then signal stdabort
  3198.   when action = 14 then signal stderror
  3199.   when action = 16 then signal stderror
  3200.   otherwise signal arexxerror
  3201. end
  3202. return
  3203.  
  3204. aaPageSysop:
  3205. procedure expose mailbox. mailbox pagedSysop
  3206. if mailbox.autopagescript ~= "" & mailbox.autopage ~= "" then do
  3207.      pagedSysop = 1
  3208.      handle = makeUniqueFile()
  3209.      call initLogEntry(); log.origmailbox = mailbox
  3210.      log.filename = 'avm:voices/autoforward'; log.type = 'voice'
  3211.      log.returnsendfunc = mailbox.autopagescript; log.returninterval = 5
  3212.      log.returnretry = 3; log.returnnumber = mailbox.autopage; log.altFileName = voiceFile(mailbox, 'Introduction')
  3213.      call saveLogEntry('Outgoing', handle)
  3214. end
  3215. return
  3216.  
  3217.  
  3218. stdabort:
  3219. exit
  3220.  
  3221. stdbusy:
  3222. exit
  3223.  
  3224. stderror:
  3225. exit
  3226.  
  3227. stdtimedout:
  3228. exit
  3229.  
  3230. stdfaxinstruct:
  3231. 'playvoice' 'avm:voices/FaxStarting'
  3232. action = rc
  3233. select
  3234.   when action = 0 then nop
  3235.   when action = 1 then do; call checkifabort; end
  3236.   when action = 4 then nop
  3237.   when action = 5 then nop
  3238.   when action = 8 then signal stdbusy
  3239.   when action = 12 then signal stdabort
  3240.   when action = 14 then nop
  3241.   when action = 16 then nop
  3242.   otherwise signal arexxerror
  3243. end
  3244.  
  3245. stdfax:
  3246. faxscript = getclip(address() || 'FAXSCRIPT')
  3247. if faxscript = '' then faxscript = 'handlefax'
  3248. if symbol('mailbox') = 'VAR' then address rexx faxscript address() mailbox
  3249. else address rexx faxscript address() 'anonymous'
  3250. exit
  3251.  
  3252. stddatainstruct:
  3253. 'playvoice' 'avm:voices/DataStarting'
  3254. action = rc
  3255. select
  3256.   when action = 0 then nop
  3257.   when action = 1 then do; call checkifabort; end
  3258.   when action = 4 then nop
  3259.   when action = 5 then nop
  3260.   when action = 8 then signal stdbusy
  3261.   when action = 12 then signal stdabort
  3262.   when action = 14 then nop
  3263.   when action = 16 then nop
  3264.   otherwise signal arexxerror
  3265. end
  3266.  
  3267. stddata:
  3268. datascript = getclip(address() || 'DATASCRIPT')
  3269. if datascript = '' then datascript = 'handledata'
  3270. if symbol('mailbox') = 'VAR' then address rexx datascript address() mailbox
  3271. else address rexx datascript address()
  3272. exit
  3273.  
  3274. checkifabort:
  3275. 'readnkeys' '1' '3'
  3276. action = rc
  3277. if action = 0 then value = result
  3278. select
  3279.   when action = 0 then do; if value = '*' then signal stdabort; end
  3280.   when action = 4 then nop
  3281.   when action = 5 then nop
  3282.   when action = 8 then signal stdbusy
  3283.   when action = 10 then nop
  3284.   when action = 12 then signal stdabort
  3285.   when action = 14 then signal stderror
  3286.   when action = 16 then signal stderror
  3287.   otherwise signal arexxerror
  3288. end
  3289. return
  3290.  
  3291.  
  3292. /* TITLE: avm:rexx/startup.avm */
  3293. multistartup:
  3294. /* This is where it all begins */
  3295.  
  3296. InitialMenu:
  3297. call aapresentmenu('avm:voices/InitialMessage', '0123456789#*', '1')
  3298. action = result
  3299. select
  3300.   when action = '=0' then signal InitialMenu
  3301.   when action = '=1' then do; call level0; end
  3302.   when action = '=2' then do; mailbox = 'anonymous'; signal stdfaxinstruct; end
  3303.   when action = '=3' then signal InitialMenu
  3304.   when action = '=4' then signal InitialMenu
  3305.   when action = '=5' then do; mailbox = 'anonymous'; signal stddatainstruct; end
  3306.   when action = '=6' then signal InitialMenu
  3307.   when action = '=7' then signal InitialMenu
  3308.   when action = '=8' then signal InitialMenu
  3309.   when action = '=9' then signal InitialMenu
  3310.   when action = '=#' then do; return; end
  3311.   when action = '=*' then signal stdabort
  3312.   when action = 4 then do; mailbox = 'anonymous'; signal stdfax; end
  3313.   when action = 5 then do; mailbox = 'anonymous'; signal stddata; end
  3314.   when action = 8 then signal stdbusy
  3315.   when action = 10 then signal startupTimedOut
  3316.   when action = 12 then signal stdabort
  3317.   when action = 14 then signal stderror
  3318.   when action = 16 then signal stderror
  3319.   otherwise signal arexxerror
  3320. end
  3321. signal InitialMenu
  3322.  
  3323. startupTimedOut:
  3324. answerpri = upper(getclip('AVMAnswerPriority'))
  3325. if answerpri = 'FAX' then do; mailbox = 'anonymous'; signal stdfax; end
  3326. else if answerpri = 'DATA' then do; mailbox = 'anonymous'; signal stddata; end
  3327. call aaprocessmailbox('anonymous')
  3328.  
  3329. /* We're done */
  3330. signal answervoiceDone
  3331.  
  3332. level0:
  3333. call aapresentmenu('avm:voices/level0', '0123#*', '3')
  3334. action = result
  3335. select
  3336.   when action = '=0' then signal level0
  3337.   when action = '=1' then call aaprocessmailbox('mailbox1')
  3338.   when action = '=2' then call aaprocessmailbox('mailbox2')
  3339.   when action = '=3' then call aaprocessmailbox('anonymous')
  3340.   when action = '=4' then nop
  3341.   when action = '=5' then nop
  3342.   when action = '=6' then nop
  3343.   when action = '=7' then nop
  3344.   when action = '=8' then nop
  3345.   when action = '=9' then nop
  3346.   when action = '=#' then signal return
  3347.   when action = '=*' then signal answervoiceDone
  3348.   when action = 4 then do; mailbox = 'anonymous'; signal stdfax; end
  3349.   when action = 5 then do; mailbox = 'anonymous'; signal stddata; end
  3350.   when action = 8 then signal stdbusy
  3351.   when action = 10 then signal answervoiceDone
  3352.   when action = 12 then signal stdabort
  3353.   when action = 14 then signal stderror
  3354.   when action = 16 then signal stderror
  3355.   otherwise signal arexxerror
  3356. end
  3357. signal level0
  3358.  
  3359.  
  3360. /* TITLE: avm:rexx/simplestartup.avm */
  3361. simplestartup:
  3362. call aaprocessmailbox('anonymous')
  3363.  
  3364. signal answervoiceDone
  3365.  
  3366.  
  3367. timeOfDay2num:
  3368. currentHours = time('hours')
  3369. if currentHours < 12 then ret = 1
  3370. else if currentHours < 18 then ret = 2
  3371. else ret = 3
  3372. return ret
  3373.  
  3374. dayOfWeek2num:
  3375. day = date('Weekday')
  3376. if day = 'Monday' then ret = 1
  3377. else if day = 'Tuesday' then ret = 2
  3378. else if day = 'Wednesday' then ret = 3
  3379. else if day = 'Thursday' then ret = 4
  3380. else if day = 'Friday' then ret = 5
  3381. else if day = 'Saturday' then ret = 6
  3382. else ret = 7
  3383. return ret
  3384.  
  3385. avintro1:
  3386. 'playvoice' 'avm:voices/intro1'
  3387. action = rc
  3388. select
  3389.   when action = 0 then nop
  3390.   when action = 1 then nop
  3391.   when action = 4 then signal stdfax
  3392.   when action = 5 then signal stddata
  3393.   when action = 8 then signal stdbusy
  3394.   when action = 12 then signal stdabort
  3395.   when action = 14 then nop
  3396.   when action = 16 then nop
  3397.   otherwise signal arexxerror
  3398. end
  3399. signal answervoiceStart
  3400.  
  3401. avintro2:
  3402. 'playvoice' 'avm:voices/intro2'
  3403. action = rc
  3404. select
  3405.   when action = 0 then nop
  3406.   when action = 1 then nop
  3407.   when action = 4 then signal stdfax
  3408.   when action = 5 then signal stddata
  3409.   when action = 8 then signal stdbusy
  3410.   when action = 12 then signal stdabort
  3411.   when action = 14 then nop
  3412.   when action = 16 then nop
  3413.   otherwise signal arexxerror
  3414. end
  3415. signal answervoiceStart
  3416.  
  3417. avintro3:
  3418. 'playvoice' 'avm:voices/intro3'
  3419. action = rc
  3420. select
  3421.   when action = 0 then nop
  3422.   when action = 1 then nop
  3423.   when action = 4 then signal stdfax
  3424.   when action = 5 then signal stddata
  3425.   when action = 8 then signal stdbusy
  3426.   when action = 12 then signal stdabort
  3427.   when action = 14 then nop
  3428.   when action = 16 then nop
  3429.   otherwise signal arexxerror
  3430. end
  3431. signal answervoiceStart
  3432.  
  3433. avintro4:
  3434. 'playvoice' 'avm:voices/intro4'
  3435. action = rc
  3436. select
  3437.   when action = 0 then nop
  3438.   when action = 1 then nop
  3439.   when action = 4 then signal stdfax
  3440.   when action = 5 then signal stddata
  3441.   when action = 8 then signal stdbusy
  3442.   when action = 12 then signal stdabort
  3443.   when action = 14 then nop
  3444.   when action = 16 then nop
  3445.   otherwise signal arexxerror
  3446. end
  3447. signal answervoiceStart
  3448.  
  3449. avintro5:
  3450. 'playvoice' 'avm:voices/intro5'
  3451. action = rc
  3452. select
  3453.   when action = 0 then nop
  3454.   when action = 1 then nop
  3455.   when action = 4 then signal stdfax
  3456.   when action = 5 then signal stddata
  3457.   when action = 8 then signal stdbusy
  3458.   when action = 12 then signal stdabort
  3459.   when action = 14 then nop
  3460.   when action = 16 then nop
  3461.   otherwise signal arexxerror
  3462. end
  3463. signal answervoiceStart
  3464.  
  3465. avintro6:
  3466. 'playvoice' 'avm:voices/intro6'
  3467. action = rc
  3468. select
  3469.   when action = 0 then nop
  3470.   when action = 1 then nop
  3471.   when action = 4 then signal stdfax
  3472.   when action = 5 then signal stddata
  3473.   when action = 8 then signal stdbusy
  3474.   when action = 12 then signal stdabort
  3475.   when action = 14 then nop
  3476.   when action = 16 then nop
  3477.   otherwise signal arexxerror
  3478. end
  3479. signal answervoiceStart
  3480.  
  3481. avintro7:
  3482. 'playvoice' 'avm:voices/intro7'
  3483. action = rc
  3484. select
  3485.   when action = 0 then nop
  3486.   when action = 1 then nop
  3487.   when action = 4 then signal stdfax
  3488.   when action = 5 then signal stddata
  3489.   when action = 8 then signal stdbusy
  3490.   when action = 12 then signal stdabort
  3491.   when action = 14 then nop
  3492.   when action = 16 then nop
  3493.   otherwise signal arexxerror
  3494. end
  3495. signal answervoiceStart
  3496.  
  3497.